-
Notifications
You must be signed in to change notification settings - Fork 3
81 lines (73 loc) · 3.69 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
name: test-qrhl-tool
on: [push]
jobs:
test-qrhl:
strategy:
matrix:
os: [linux, windows, macos]
runs-on: [self-hosted, "${{matrix.os}}"]
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: true
- name: Running tests (Linux)
if: matrix.os == 'linux'
run: |
git submodule foreach --recursive git clean -ffdx # GitHub actions doesn't clean the submodules, see https://github.com/actions/checkout/issues/358
ISABELLE_VERSION="`cat src/main/resources/qrhl/isabellex/isabelleVersion`"
echo "isabelle-home = /opt/Isabelle$ISABELLE_VERSION" >qrhl-tool.conf
echo "afp-root = /opt/afp-$ISABELLE_VERSION" >>qrhl-tool.conf
sbt 'testOnly -- -h target/test-reports-html'
- name: Running tests (Windows)
if: matrix.os == 'windows'
run: |
git submodule foreach --recursive git clean -ffdx # GitHub actions doesn't clean the submodules, see https://github.com/actions/checkout/issues/358
$ISABELLE_VERSION = Get-Content -Path src\main\resources\qrhl\isabellex\isabelleVersion
Set-Content -Path qrhl-tool.conf -Value "isabelle-home = c:\Isabelle$ISABELLE_VERSION"
Add-Content -Path qrhl-tool.conf -Value "afp-root = c:\afp-$ISABELLE_VERSION"
sbt 'testOnly -- -h target/test-reports-html'
- name: Running tests (MacOS)
if: matrix.os == 'macos'
run: |
ifconfig # To find out address for SSHing
git submodule foreach --recursive git clean -ffdx # GitHub actions doesn't clean the submodules, see https://github.com/actions/checkout/issues/358
~/keepawake.sh & # A script to keep the Mac from falling asleep. Caffeinate doesn't seem to work on my Mac
ISABELLE_VERSION="`cat src/main/resources/qrhl/isabellex/isabelleVersion`"
echo "isabelle-home = $HOME/Isabelle$ISABELLE_VERSION.app" >qrhl-tool.conf
echo "afp-root = $HOME/afp-$ISABELLE_VERSION" >>qrhl-tool.conf
# My Mac is very small. So we make sure there is no other parallel GitHub action running before continuing.
while pgrep -l -f sbt-launch.jar; do echo "Another sbt is running. To keep load low, we wait until it finishes."; caffeinate -i -t 300; done
~/keepawake.sh & # Another invocation in case we waited very long
sbt 'testOnly -- -h target/test-reports-html'
# - name: Cleanup (MacOS)
# if: matrix.os == 'macos'
# run: |
# kill `cat keepawake.pid` || true
- name: Upload test results
uses: actions/upload-artifact@v3
if: always()
with:
name: test-reports-html-${{matrix.os}}
path: target/test-reports-html
qrhl-zip:
runs-on: [self-hosted, linux]
needs: test-qrhl
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: true
- name: make qrhl.zip
run: |
set -e
git clean -fdx # Otherwise GITREVISION in qrhl.zip may say "(modified working copy)"
make qrhl.zip
# This uploads a double ZIP (see https://github.com/actions/upload-artifact#zipped-artifact-downloads).
# We cannot circumvent this by giving a directory to `upload-artifact` (as done in c618ad87) because then executable bits are lost.
# (See https://github.com/actions/upload-artifact#permission-loss).
- name: Upload qrhl.zip
uses: actions/upload-artifact@v3
with:
name: qrhl
path: qrhl.zip