-
Notifications
You must be signed in to change notification settings - Fork 13
134 lines (116 loc) · 3.66 KB
/
Copy pathvalidation.yml
File metadata and controls
134 lines (116 loc) · 3.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# NOTE: this workflow file is the only one allowed to be run on self-hosted
# runners. don't change its name!
name: Validation
on:
push:
branches:
- main
- "releases/**"
paths-ignore:
- "**.md"
pull_request:
types:
- opened
- synchronize
- reopened
- labeled
release:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
run_validation:
name: Run validation suite
runs-on: self-hosted # ubuntu-latest
# Run rules:
# - always run for releases
# - for PRs: only when label "run validation" exists
# - for pushes to main: skip when commit message contains "[skip val]"
if: >
github.event_name == 'release' ||
(
github.event_name == 'pull_request' &&
(
(
github.event.action == 'labeled' &&
github.event.label.name == 'run-validation'
) ||
(
github.event.action != 'labeled' &&
contains(join(github.event.pull_request.labels.*.name, ','), 'run-validation')
)
)
) ||
(
github.event_name == 'push' &&
!contains(github.event.head_commit.message, '[skip val]')
)
container: docker://legendexp/remage-base:stable
permissions:
contents: read
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
fetch-tags: true
ref: ${{ github.event.pull_request && github.event.pull_request.head.sha || github.ref }}
- name: Build project
shell: bash # make the pipes to tee below propagate errors (pipefail is on by default).
run: |
git config --global --add safe.directory $(pwd) # make git work inside container.
mkdir build
cd build
cmake -DBUILD_TESTING=ON -DRMG_BUILD_DOCS=OFF .. | tee -a build.log
make -j$(nproc) | tee -a build.log
make install | tee -a build.log
- name: Run validation test suite
run: |
cd build
ctest --label-regex val --label-exclude mt -j$(nproc) --output-on-failure
ctest --label-regex val --label-regex mt -j1 --output-on-failure
- name: Build validation report
run: |
cd build
cmake -DRMG_BUILD_DOCS=ON ..
make sphinx-validation
- name: Disk space statistics
run: |
cd build/tests
du -sh *
df -h .
- name: Upload validation report to GitHub
if: ${{ always() }}
uses: actions/upload-artifact@v7
with:
name: remage-validation-report
path: build/docs/validation/_build/
deploy_validation_report:
name: Deploy validation report to legend-exp.github.io/remage/validation
if: github.event_name != 'pull_request'
needs: run_validation
runs-on: ubuntu-latest
permissions:
contents: write
pages: write
steps:
- name: Download artifact
uses: actions/download-artifact@v8
with:
name: remage-validation-report
path: output/
- name: Determine target directory
id: target
run: |
if [[ "${{ github.event_name }}" == "release" ]]; then
echo "dir=$(echo '${{ github.event.release.tag_name }}')" >> $GITHUB_ENV
else
echo "dir=latest" >> $GITHUB_ENV
fi
- name: Deploy to gh-pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: output
destination_dir: validation/${{ env.dir }}
# vim: expandtab tabstop=2 shiftwidth=2