-
Notifications
You must be signed in to change notification settings - Fork 3
213 lines (193 loc) · 7.29 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
name: CI
on:
push:
# branches: [ master, tmp ]
pull_request:
branches: [ master ]
jobs:
test:
name: ${{ matrix.lisp }} on ${{ matrix.os }}
strategy:
matrix:
# sbcl32 and clisp32 don't work, clasp won't build on CI servers
lisp: [sbcl-bin,sbcl,ccl-bin,ccl32,ecl,clisp,allegro,cmucl,abcl]
os: [ubuntu-latest, macos-latest, windows-latest]
exclude:
## some implementations don't install/build properly on windows
# - os: windows-latest
# lisp: allegro
# - os: windows-latest
# lisp: cmucl
# - os: windows-latest
# lisp: abcl
# - os: windows-latest
# lisp: ecl
# - os: windows-latest
# lisp: clisp
## CFFI requires CLISP compiled with dynamic FFI support.
# - os: macos-latest
# lisp: clisp
## sbcl-bin is too old on macos
# - os: macos-latest
# lisp: sbcl-bin
## skip 32bit lisps on osx
# - os: macos-latest
# lisp: sbcl32
# - os: macos-latest
# lisp: ccl32
# - os: macos-latest
# lisp: clisp32
# - os: macos-latest
# lisp: allegro
# - os: macos-latest
# lisp: cmucl
## clisp doesn't build with current readline, do disable on linux too for now
# - os: ubuntu-latest
# lisp: clisp
## roswell can't install ccl 1.12.1 on windows, so skip ccl32 there
# - os: windows-latest
# lisp: ccl32
fail-fast: false
runs-on: ${{ matrix.os }}
defaults:
run:
# specify default shell explicitly to get msys instead of git-bash
# on windows, and to get a login shell elsewher so we can use
# .bash_profile
shell: ${{ fromJSON('[ "bash -leo pipefail", "msys2" ]') [ matrix.os == 'windows-latest' ] }} "{0}"
steps:
- uses: msys2/setup-msys2@v2
if: matrix.os == 'windows-latest'
with:
path-type: minimal
msystem: MINGW64
# set these to true if we want to install things from pacman
release: true
update: true
# list all packages we want installed if using release&update true
install: 'git base-devel unzip mingw-w64-x86_64-gcc mingw64/mingw-w64-x86_64-zlib'
- name: windows specific settings
if: matrix.os == 'windows-latest'
# run with powershell so it sets the git config used by actions/checkout
shell: pwsh
run: |
git config --global core.autocrlf false
git config --global core.eol lf
# make sure MSYSCON is set so roswell doesn't try to install msys
echo "MSYSCON=defterm" | Out-File -FilePath $env:GITHUB_ENV -Append
# roswell installs to windows profile dir, so add to PATH using
# pwsh $HOME also
echo "$HOME/.roswell/bin" | Out-File -FilePath $env:GITHUB_PATH -Append
# not sure what makes roswell install things here
echo "$HOME/.roswell/lisp/quicklisp/bin" | Out-File -FilePath $env:GITHUB_PATH -Append
echo home = $HOME
echo userprofile = $USERPROFILE
- uses: actions/checkout@v4
# check out into subdir so we can pull other projects next to it.
# roswell CI script sets up current dir as asdf search tree
with:
path: pngload
- name: ci-utils fork
uses: actions/checkout@v4
with:
repository: 3b/ci-utils
ref: test2
path: ci-utils
- name: skippy fork
uses: actions/checkout@v4
with:
repository: 3b/skippy
path: skippy
- name: cache .roswell
id: cache-dot-roswell
uses: actions/cache@v4
with:
path: ~/.roswell
key: ${{ runner.os }}-dot-roswell-${{ matrix.lisp }}-${{ hashFiles('**/*.asd') }}
restore-keys: |
${{ runner.os }}-dot-roswell-${{ matrix.lisp }}-
${{ runner.os }}-dot-roswell-
- name: install roswell
# always run install, since it does some global installs and setup
# that isn't cached
env:
LISP: ${{ matrix.lisp }}
run: curl -L https://raw.githubusercontent.com/roswell/roswell/master/scripts/install-for-ci.sh | sh -x
- name: print version/configuration info
continue-on-error: true
run: |
set -x
ros -e '(format t "~a:~a on ~a~%...~%~%" (lisp-implementation-type) (lisp-implementation-version) (machine-type))'
ros -e '(format t " fixnum bits:~a~%" (integer-length most-positive-fixnum))'
ros -e "(ql:quickload 'trivial-features)" -e '(format t "features = ~s~%" *features*)'
uname -a
which gcc
gcc --version
- name: update ql dist if we have one cached
run: |
ros -e "(ql:update-all-dists :prompt nil)"
- name: install ci-utils
run: |
ros install ci-utils
echo "$HOME/.roswell/bin" >> $GITHUB_PATH
echo "$HOME/.roswell/bin"
# we specified a login shell above, so use bash_profile to define
# a test wrapper function for tests below
cat <<"EOF" > ~/.bash_profile
echo "loading functions"
if [ -z $MSYSCON ] ; then
CI_UTILS=$GITHUB_WORKSPACE/ci-utils
else
CI_UTILS=$(cygpath $GITHUB_WORKSPACE)/ci-utils
fi
RUN=$CI_UTILS/roswell/run-test-forms.ros
# arbitrary exit code we tell lisp code to use to signal success
PASS=33
# value we expect on "successful" run of a test, usually $PASS
# unless the test isn't expected to return normally from the
# lisp code
EXPECT=$PASS
run_tests () {
# passes arguments to run-test-forms, so use like
# run_tests -l system (form)
echo "$RUN $*"
# run in a subshell to minimize scope of +e
( set +e
$RUN -r $PASS "$@"
local RET=$?
set -e
if [ $RET -eq $EXPECT ]
then
echo -e "\033[0;32mGot $RET, expected $EXPECT: OK\033[0m"
true
else
echo -e "\033[0;31mGot $RET, expected $EXPECT: BAD $fail\033[0m"
false
fi
)
}
EOF
- name: clear fasl cache
run: |
[ -d "$USERPROFILE/AppData/Local/cache/common-lisp/" ] && rm -rf $USERPROFILE/AppData/Local/cache/common-lisp/
[ -d "~/.cache/common-lisp/" ] && rm -rf ~/.cache/common-lisp/
mkdir -p ~/.cache/common-lisp/
- name: load code from clean fasl cache and run tests
run: |
run_tests -l pngload.test '(pngload.test:run-tests-for-ci)'
- name: load code from fasls and run tests
run: |
run_tests -l pngload.test '(pngload.test:run-tests-for-ci)'
- name: test read times
run: |
curl https://3bb.cc/tmp/fft.png -o fft.png
run_tests -l pngload.test '(or (pngload.test:test-read-times "fft.png" :count 10) t)'
- name: smoke test
# make sure test failures are caught as expected so we don't
# miss failures in the real tests
run: |
EXPECT=1 run_tests -l pngload.test NIL
EXPECT=2 run_tests -l pngload.test "(cl:error)"
EXPECT=3 run_tests -l "system that does not exist"
PASS=123 EXPECT=123 run_tests t
PASS=123 EXPECT=1 run_tests nil