-
Notifications
You must be signed in to change notification settings - Fork 73
225 lines (205 loc) · 7.79 KB
/
Copy pathdaily_test_all_latest_deps.yml
File metadata and controls
225 lines (205 loc) · 7.79 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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
name: Daily test all (latest dependencies)
on:
schedule:
- cron: "30 6 * * *"
workflow_dispatch:
pull_request:
types: [labeled, synchronize]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
actions: write
contents: read
jobs:
delete_cache:
name: Delete github action cache
if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'run-daily-ci')
runs-on: ubuntu-latest
continue-on-error: true
permissions:
actions: write
steps:
- name: Delete caches for this ref
env:
GH_TOKEN: ${{ github.token }}
REF: ${{ github.ref }}
REPO: ${{ github.repository }}
run: |
set -u
gh cache list -R "$REPO" --ref "$REF" --limit 100 --json id --jq '.[].id' \
| while read -r id; do
gh cache delete -R "$REPO" "$id" || echo "skipped $id (already gone)"
done
resolve_deps:
name: Resolve newest dependencies
if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'run-daily-ci')
runs-on: ubuntu-latest
outputs:
deps: ${{ steps.resolve.outputs.deps }}
test_deps: ${{ steps.resolve.outputs.test_deps }}
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Resolve dependencies
id: resolve
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
if ! DEPS=$(python3 tools/resolve_newest_deps.py .pinned 2>"$RUNNER_TEMP/resolve_deps.log"); then
cat "$RUNNER_TEMP/resolve_deps.log"
exit 1
fi
if ! TEST_DEPS=$(python3 tools/resolve_newest_deps.py tests/.pinned 2>"$RUNNER_TEMP/resolve_test_deps.log"); then
cat "$RUNNER_TEMP/resolve_test_deps.log"
exit 1
fi
cat "$RUNNER_TEMP/resolve_deps.log"
cat "$RUNNER_TEMP/resolve_test_deps.log"
if [ -z "$DEPS" ]; then
echo "ERROR: dependency resolver produced no output" >&2
exit 1
fi
if [ -z "$TEST_DEPS" ]; then
echo "ERROR: test dependency resolver produced no output" >&2
exit 1
fi
printf 'deps=%s\n' "$DEPS" >> "$GITHUB_OUTPUT"
printf 'test_deps=%s\n' "$TEST_DEPS" >> "$GITHUB_OUTPUT"
test:
needs: [delete_cache, resolve_deps]
if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'run-daily-ci')
env:
NIMBLE_COMMIT: 9207e8b2bbdf66b5a4d1020214cff44d2d30df92 # v0.20.1
timeout-minutes: 70
strategy:
fail-fast: false
matrix:
config:
- os: linux
cpu: amd64
cc: gcc
builder: ubuntu-22.04
shell: bash
- os: linux-gcc-14
cpu: amd64
cc: gcc
builder: ubuntu-24.04
shell: bash
- os: windows
cpu: amd64
cc: clang
builder: windows-2022
shell: bash
- os: windows
cpu: amd64
cc: gcc
builder: windows-2022
shell: "msys2 {0}"
- os: linux
cpu: i386
cc: gcc
builder: ubuntu-22.04
shell: bash
nim:
- ref: v2.2.4
memory_management: refc
- ref: v2.2.10
memory_management: refc
- ref: devel
memory_management: refc
defaults:
run:
shell: ${{ matrix.config.shell }}
name: "${{ matrix.config.os }}-${{ matrix.config.cpu }} (${{ matrix.nim.ref }}; ${{ matrix.config.cc }}; ${{ matrix.nim.memory_management }})"
runs-on: ${{ matrix.config.builder }}
steps:
- name: Checkout
uses: actions/checkout@v6
with:
submodules: true
- name: Setup Nim
uses: "./.github/actions/install_nim"
with:
os: ${{ matrix.config.os }}
shell: ${{ matrix.config.shell }}
nim_ref: ${{ matrix.nim.ref }}
cpu: ${{ matrix.config.cpu }}
- name: Restore llvm-mingw (Windows) from cache
if: runner.os == 'Windows' && matrix.config.cc == 'clang'
id: windows-mingw-cache
uses: actions/cache@v5
with:
path: external/mingw-${{ matrix.config.cpu }}
key: 'mingw-llvm-17-${{ matrix.config.cpu }}'
- name: Install llvm-mingw dependency (Windows)
if: >
steps.windows-mingw-cache.outputs.cache-hit != 'true' &&
runner.os == 'Windows' &&
matrix.config.cc == 'clang'
run: |
mkdir -p external
MINGW_BASE="https://github.com/mstorsjo/llvm-mingw/releases/download/20230905"
MINGW_URL="$MINGW_BASE/llvm-mingw-20230905-ucrt-x86_64.zip"
curl -L "$MINGW_URL" -o "external/mingw-${{ matrix.config.cpu }}.zip"
7z x -y "external/mingw-${{ matrix.config.cpu }}.zip" -oexternal/mingw-${{ matrix.config.cpu }}/
mv external/mingw-${{ matrix.config.cpu }}/**/* ./external/mingw-${{ matrix.config.cpu }}
- name: Use gcc 14
if: ${{ matrix.config.os == 'linux-gcc-14'}}
run: |
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 14
sudo update-alternatives --set gcc /usr/bin/gcc-14
- name: Path to cached dependencies (Windows)
if: >
runner.os == 'Windows' &&
matrix.config.cc == 'clang'
run: |
echo '${{ github.workspace }}'"/external/mingw-${{ matrix.config.cpu }}/bin" >> $GITHUB_PATH
echo "." >> $GITHUB_PATH
- name: Install nasm (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
choco install nasm --no-progress -y
"C:\Program Files\NASM" | Out-File -FilePath $Env:GITHUB_PATH -Encoding utf8 -Append
- name: Install dependencies (newest used across projects)
env:
DEPS: ${{ needs.resolve_deps.outputs.deps }}
TEST_DEPS: ${{ needs.resolve_deps.outputs.test_deps }}
run: |
if [ -z "$DEPS" ]; then
echo "ERROR: dependency resolver produced no output for this workflow run" >&2
exit 1
fi
if [ -z "$TEST_DEPS" ]; then
echo "ERROR: test dependency resolver produced no output for this workflow run" >&2
exit 1
fi
echo "=== Installing resolved newest dependencies ==="
# nimbledeps/ switches nimble to local-dep mode for the pinned build.
rm -rf nimbledeps tests/nimbledeps
mkdir nimbledeps
echo "nimble install -y $DEPS"
nimble install -y $DEPS
mkdir tests/nimbledeps
echo "cd tests && nimble install -y $TEST_DEPS"
(cd tests && nimble install -y $TEST_DEPS)
- name: Build prerequisites
run: make nimble.paths tests/nimble.paths
- name: Build test_all
run: |
NIMFLAGS="--mm:${{ matrix.nim.memory_management }} --opt:speed --styleCheck:usages --styleCheck:error --parallelBuild:0 --threads:on --skipUserCfg"
NIMFLAGS="$NIMFLAGS -d:chronicles_log_level=DEBUG"
NIMFLAGS="$NIMFLAGS --debugger:native --stacktrace:off --import:libbacktrace --define:nimStackTraceOverride"
if [[ '${{ matrix.config.cc }}' == 'clang' ]]; then
NIMFLAGS="$NIMFLAGS --cc:clang"
fi
nim c $NIMFLAGS ./tests/test_all
- name: Run tests
run: |
./tests/test_all --output-level=VERBOSE --console --xml:tests/results_test_all.xml
- name: Run integration tests
if: ${{ matrix.config.os == 'linux' && matrix.config.cpu == 'amd64' }}
run: |
export NIMFLAGS="${NIMFLAGS} -d:chronicles_log_level=DEBUG"
make test_integration