7
7
- ' **'
8
8
schedule :
9
9
- cron : ' 0 0 * * 0'
10
+ workflow_dispatch :
10
11
jobs :
11
12
tidy :
12
13
name : Enforce Tidyness
13
14
runs-on : ubuntu-22.04
14
15
steps :
15
- - uses : actions/checkout@v2
16
+ - uses : actions/checkout@v3
16
17
with :
17
18
submodules : ' recursive'
18
19
- run : sudo apt-get update -qq
@@ -22,12 +23,20 @@ jobs:
22
23
name : Test Tidy Enforcement on macOS
23
24
runs-on : macos-11
24
25
steps :
25
- - uses : actions/checkout@v2
26
+ - uses : actions/checkout@v4
26
27
with :
28
+ # sometimes checkout action doesn't result in clean directory?
29
+ fetch-depth : 0
30
+ ref : ${{ github.event.pull_request.head.sha || github.ref }}
27
31
submodules : ' recursive'
32
+ - run : git status --ignored
28
33
- run : brew install coreutils findutils gnu-sed gawk grep rename sphinx-doc
29
34
# adapted from https://stackoverflow.com/a/42878119
30
35
- run : brew link sphinx-doc --force
36
+ # updates PATH to use Homebrew-installed tools first
37
+ # see https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#adding-a-system-path
38
+ - run : echo "/usr/local/bin:$PATH" > $GITHUB_PATH
39
+ - run : echo $PATH
31
40
- run : ./ci/test_tidy.sh
32
41
test :
33
42
name : Tests
@@ -47,13 +56,17 @@ jobs:
47
56
CXX : ${{ matrix.cxx }}
48
57
TEST_SET : ${{ matrix.test-set }}
49
58
steps :
50
- - uses : actions/checkout@v2
59
+ - uses : actions/checkout@v3
51
60
with :
52
61
submodules : ' recursive'
53
62
- name : Set up GCC
54
63
uses : egor-tensin/setup-gcc@v1
55
64
with :
56
65
version : 11
66
+ - name : Set up clang
67
+ uses : egor-tensin/setup-clang@v1
68
+ with :
69
+ version : 15
57
70
- run : sudo apt-get update -qq
58
71
- run : sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
59
72
- run : sudo apt-get update -qq
68
81
name : Web Tests
69
82
runs-on : ubuntu-20.04
70
83
steps :
71
- - uses : actions/checkout@v2
84
+ - uses : actions/checkout@v3
72
85
with :
73
86
submodules : ' recursive'
74
87
- name : Set up GCC
86
99
name : Measure Test Coverage
87
100
runs-on : ubuntu-22.04
88
101
steps :
89
- - uses : actions/checkout@v2
102
+ - name : Set up clang
103
+ uses : egor-tensin/setup-clang@v1
104
+ with :
105
+ version : 15
106
+ - uses : actions/checkout@v3
90
107
with :
91
108
submodules : ' recursive'
92
109
- run : sudo apt-get update -qq
@@ -96,26 +113,81 @@ jobs:
96
113
- run : export CXX=clang++ && make install-coverage-dependencies
97
114
- run : export CXX=clang++ && make coverage
98
115
- run : curl -s https://codecov.io/bash | bash
116
+ # adapted from https://docs.github.com/en/packages/managing-github-packages-using-github-actions-workflows/publishing-and-installing-a-package-with-github-actions#publishing-a-package-using-an-action
117
+ build-container :
118
+ name : Build Docker Image
119
+ runs-on : ubuntu-22.04
120
+ env :
121
+ REGISTRY : ghcr.io
122
+ IMAGE_NAME : ${{ github.repository }}
123
+ permissions :
124
+ contents : read
125
+ packages : write
126
+ steps :
127
+ - uses : actions/checkout@v2
128
+ with :
129
+ submodules : ' recursive'
130
+ - name : Log in to GitHub Container Registry
131
+ uses : docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
132
+ with :
133
+ registry : ghcr.io
134
+ username : ${{ github.actor }}
135
+ password : ${{ secrets.GITHUB_TOKEN }}
136
+ - name : Extract metadata (tags, labels) for Docker
137
+ id : meta
138
+ uses : docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
139
+ with :
140
+ images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
141
+ tags : type=raw,value=ACTIONS_BUILD_${{ github.run_number }}
142
+ - name : Push to GHCR
143
+ uses : docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
144
+ with :
145
+ context : .
146
+ push : true
147
+ tags : ${{ steps.meta.outputs.tags }}
148
+ labels : ${{ steps.meta.outputs.labels }}
99
149
test-documentation :
100
150
name : Test Documentation Build
101
151
runs-on : ubuntu-22.04
152
+ needs : build-container
153
+ container :
154
+ image : ghcr.io/devosoft/empirical:ACTIONS_BUILD_${{ github.run_number }}
155
+ # github actions requires root to access mounted volumes
156
+ options : --user root
102
157
steps :
103
- - uses : actions/checkout@v2
158
+ - uses : actions/checkout@v3
104
159
with :
105
160
submodules : ' recursive'
106
- - uses : mmore500/actions-setup-docker@94429ebc8d9edb4e8c8afb2667bce1e89435f74f
107
- - run : docker build -t devosoft/empirical .
108
- - run : docker ps -a
109
- - run : sudo docker run --name empirical devosoft/empirical /bin/bash -c "set -o pipefail && cd /opt/Empirical/doc && make html coverage | ./headtail.sh && python /opt/Empirical/doc/parse_documentation_coverage.py /opt/Empirical/doc/_build/doc-coverage.json >> /opt/Empirical/doc-coverage.json"
110
- - run : sudo docker cp empirical:/opt/Empirical/doc-coverage.json .
161
+ - run : doxygen
162
+ - run : cd doc && python make_md.py
163
+ - run : cd doc && make html | ./headtail.sh
164
+ - run : cd doc && make coverage
165
+ - run : ls doc/ && ls doc/_build
166
+ - run : cd doc && python parse_documentation_coverage.py _build/doc-coverage.json >> doc-coverage.json
167
+ - uses : actions/upload-artifact@v2
168
+ with :
169
+ name : doc-coverage
170
+ path : doc/doc-coverage.json
171
+ deploy-documentation-coverage :
172
+ name : Deploy Documentation Coverage
173
+ runs-on : ubuntu-22.04
174
+ if : github.ref == 'refs/heads/master'
175
+ needs : test-documentation
176
+ steps :
177
+ - uses : actions/download-artifact@v2
178
+ with :
179
+ name : doc-coverage
180
+ path : data
111
181
- uses : sylvanld/action-storage@v1
112
- if : github.ref == 'refs/heads/master'
113
182
with :
114
- src : doc-coverage.json
115
- dst : stats /doc-coverage.json
116
- deploy-dockerhub :
117
- name : Deploy to DockerHub
183
+ src : data/ doc-coverage.json
184
+ dst : data /doc-coverage.json
185
+ deploy-container :
186
+ name : Deploy to DockerHub and ghcr.io
118
187
runs-on : ubuntu-22.04
188
+ permissions :
189
+ contents : read
190
+ packages : write
119
191
if : github.ref == 'refs/heads/master'
120
192
needs :
121
193
- tidy
0 commit comments