-
Notifications
You must be signed in to change notification settings - Fork 27
216 lines (216 loc) · 7.4 KB
/
test.yml
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
---
name: Test
on: [push]
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
working-directory: ${{ github.workspace }}
outputs:
HASH_KEY: ${{ steps.build-clone-main.outputs.HASH_KEY }}
steps:
- name: Clone Chez Scheme
id: build-clone-main
run: |
git clone --filter=blob:none --branch main https://github.com/cisco/ChezScheme.git
echo "HASH_KEY=$(cat ChezScheme/.git/refs/heads/main)" >> "${GITHUB_OUTPUT}"
- name: Establish Chez Scheme .git / boot file cache
id: build-restore-bootfiles
uses: actions/cache@v3
env:
cache-name: boot-files
with:
path: |
ChezScheme/boot
ChezScheme/.git*
key: ${{ steps.build-clone-main.outputs.HASH_KEY }}
enableCrossOsArchive: true
- if: ${{ steps.build-restore-bootfiles.outputs.cache-hit != 'true' }}
name: Populate boot file cache
run: |
cd ChezScheme
git checkout v9.6.4
./configure -m=a6le
cd a6le/c
make -j 4
cd ../..
mkdir -p ../build/bin ../build/lib/csv9.6.4/a6le
cp a6le/bin/a6le/* ../build/bin
cp boot/a6le/* ../build/lib/csv9.6.4/a6le
export PATH=$(realpath ../build/bin):${PATH}
export SCHEMEHEAPDIRS=$(realpath ../build/lib/csv9.6.4/a6le):
git checkout main
git clean -dxf .
./configure --force -m=a6le
make re.boot
make
make bootquick XM=a6osx
make bootquick XM=a6nt
make bootquick XM=i3le
make bootquick XM=ta6nt
make bootquick XM=ta6le
mats:
continue-on-error: ${{ startsWith(matrix.machine, 't') }}
needs: build
strategy:
fail-fast: true
matrix:
config:
- machine: a6osx
os: macos-12
chez: v9.6.4
- machine: a6osx
os: macos-12
chez: main
- machine: i3le
os: ubuntu-22.04
chez: main
- machine: a6le
os: ubuntu-22.04
chez: v9.6.4
- machine: a6le
os: ubuntu-22.04
chez: main
- machine: ta6le
os: ubuntu-22.04
chez: main
- machine: i3nt
os: windows-2022
chez: v9.6.4
- machine: a6nt
os: windows-2019
chez: v9.6.4
- machine: a6nt
os: windows-2022
chez: v9.6.4
- machine: a6nt
os: windows-2022
chez: v9.6.4
- machine: a6nt
os: windows-2022
chez: main
- machine: ta6nt
os: windows-2022
chez: main
runs-on: ${{ matrix.config.os }}
defaults:
run:
shell: bash
working-directory: ${{ github.workspace }}
steps:
- name: Setup 32-bit Linux
if: ${{ endsWith(matrix.config.machine, 'i3le') }}
run: |
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install gcc-multilib lib32ncurses5-dev\
libsystemd-dev:i386 uuid-dev:i386
- name: Setup 64-bit Linux
if: ${{ endsWith(matrix.config.machine, 'a6le') }}
run: |
sudo apt-get update
sudo apt-get install libsystemd-dev
- name: Setup Mac
if: ${{ runner.os == 'macOS' }}
run: |
brew install coreutils
echo "TIMEOUT_SCALE_FACTOR=10" >> $GITHUB_ENV
- name: Setup Windows
if: ${{ runner.os == 'Windows' }}
run: git config --global core.autocrlf false
- name: Checkout repository
uses: actions/checkout@v3
# the checkout action wipes the workarea, so do the checkout
# *before* we restore and build Chez Scheme from cache
- name: Restore Chez Scheme .git / boot file cache
id: mats-restore-bootfiles
uses: actions/cache@v3
env:
cache-name: boot-files
with:
path: |
ChezScheme/boot
ChezScheme/.git*
key: ${{ needs.build.outputs.HASH_KEY }}
enableCrossOsArchive: true
- name: Fail if no cache
if: ${{ steps.mats-restore-bootfiles.outputs.cache-hit != 'true' }}
run: exit 1
- name: Build Chez Scheme ${{ matrix.config.chez }}
run: |
M=${{ matrix.config.machine }}
cd ChezScheme
git checkout -q -f ${{ matrix.config.chez }}
git reset --hard ${{ matrix.config.chez }}
if [ "${{ matrix.config.chez }}" = "main" ]; then
./configure -m=$M --force
make bin/zuo
if [ "$RUNNER_OS" = "Windows" ]; then
cmd //c build.bat $M //force //as-is //MD //kernel
else
cd $M
../bin/zuo . kernel
cd ..
fi
else
./configure -m=$M
cd $M/c
make
cd ../..
fi
if [ "$RUNNER_OS" = "Windows" ]; then
echo "$(cygpath -u "$PWD/$M/bin/$M")" >> $GITHUB_PATH
echo "SCHEMEHEAPDIRS=$(cygpath -w "$PWD/$M/boot/$M")" >> $GITHUB_ENV
else
echo "$(realpath "$PWD/$M/bin/$M")" >> $GITHUB_PATH
echo "SCHEMEHEAPDIRS=$(realpath $PWD/$M/boot/$M)" >> $GITHUB_ENV
fi
echo "done building in $PWD"
- name: Build Swish
run: ./configure && make
- name: Run tests
run: make test || echo "Run tests failed" >> failures
- name: Archive test results
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.config.machine }}-${{ matrix.config.chez }}-test
path: |
data/mat-report.html
src/swish/*.mo
- name: Run coverage
run: .github/workflows/unless-failed.sh coverage
- name: Archive coverage results
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.config.machine }}-${{ matrix.config.chez }}-coverage
path: |
data/mat-report.html
src/swish/*.mo
- name: Archive coverage reports
if: ${{ matrix.config.chez == 'main' }}
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.config.machine }}-${{ matrix.config.chez }}-coverage-report
path: |
data/coverage.html
data/src/**/*.html
- name: Assemble tarball
if: ${{ matrix.config.chez != 'main' && !startsWith(matrix.config.machine, 't') }}
# install only the binaries and replace absolute symlinks with relative symlinks
run: |
make -C src/swish install-bin INSTALLROOT="${PWD}/build/swish"
for f in $(find build/swish -type l); do
target="$(realpath "$f")"
ln -vsf "../$(realpath --relative-to="${PWD}/build/swish" "${target}")" "$f"
done
tar -cvf ${{ matrix.config.machine }}-${{ matrix.config.chez }}-build.tar build/swish
- name: Archive build artifacts
if: ${{ matrix.config.chez != 'main' && !startsWith(matrix.config.machine, 't') }}
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.config.machine }}-${{ matrix.config.chez }}-build.tar
path: ${{ matrix.config.machine }}-${{ matrix.config.chez }}-build.tar
- name: Check for failures
run: if test -f failures; then cat failures; exit 1; fi