-
Notifications
You must be signed in to change notification settings - Fork 20
83 lines (82 loc) · 3.07 KB
/
pr.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
name: Build on PR
on: [pull_request]
jobs:
test:
name: Build and Test
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [
macos-latest,
ubuntu-latest]
ocaml-compiler: [
'0',
'1',
'2',
]
steps:
- name: Install deps
if: matrix.operating-system == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install --yes time
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Clone repo
uses: actions/checkout@v3
- name: Get OCaml version
run: |
INDEX=${{ matrix.ocaml-compiler }}
OCAML_VERSION=\
`python .github/workflows/ocaml_versions.py $INDEX`
echo "OCAML_VERSION=$OCAML_VERSION" \
>> $GITHUB_ENV
echo "OCAML_VERSION = $OCAML_VERSION"
- uses: ocaml/setup-ocaml@v2
with:
ocaml-compiler: ${{ env.OCAML_VERSION }}
# - uses: actions/cache@v3
# id: cache
# with:
# path: _build_cache
# key: ${{ runner.os }}_build_cache
- name: Build installer of TLAPS
run: |
eval $(opam env)
opam install ./ --deps-only --yes
make
make release
- name: Get TLA+ examples
uses: actions/checkout@v3
with:
repository: tlaplus/examples
path: tlaplus-examples
- name: Check proofs in TLA+ examples
run: |
EXAMPLES_DIR=tlaplus-examples
mkdir $EXAMPLES_DIR/deps
cp ./_build/tlaps*.tar.gz $EXAMPLES_DIR/deps/tlaps.tar.gz
tar -xf $EXAMPLES_DIR/deps/tlaps.tar.gz -C $EXAMPLES_DIR/deps
rm $EXAMPLES_DIR/deps/tlaps.tar.gz
find $EXAMPLES_DIR/deps
mv $EXAMPLES_DIR/deps/tlaps*.bin $EXAMPLES_DIR/deps/tlaps.bin
chmod +x $EXAMPLES_DIR/deps/tlaps.bin
./$EXAMPLES_DIR/deps/tlaps.bin -d $EXAMPLES_DIR/deps/tlapm-install
python $EXAMPLES_DIR/.github/scripts/check_proofs.py \
--tlapm_path $EXAMPLES_DIR/deps/tlapm-install \
--manifest_path $EXAMPLES_DIR/manifest.json
- name: Run a subset of `tlapm` tests
run: |
eval $(opam env)
make test-inline test-fast-basic
- name: Run all `tlapm` tests
run: |
eval $(opam env)
make test
- name: Print Test Results
if: matrix.operating-system == 'ubuntu-latest'
run: |
cat _build/default/test/tests.log