-
Notifications
You must be signed in to change notification settings - Fork 200
168 lines (166 loc) · 7.2 KB
/
CI.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
name: Check Specs & Metadata
on:
push:
branches:
- master
pull_request:
branches:
- master
repository_dispatch:
types: [tlaplus-dispatch]
jobs:
validate:
name: Validate Manifest, Specs, & Models
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
unicode: [true, false]
fail-fast: false
env:
SCRIPT_DIR: .github/scripts
DEPS_DIR: deps
defaults:
run:
shell: bash
steps:
- name: Clone repo
uses: actions/checkout@v4
- name: Install python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install Java
uses: actions/setup-java@v4
with:
distribution: adopt
java-version: 17
- name: Download TLA⁺ dependencies (Windows)
if: matrix.os == 'windows-latest'
run: $SCRIPT_DIR/windows-setup.sh $SCRIPT_DIR $DEPS_DIR false
- name: Download TLA⁺ dependencies (Linux & macOS)
if: matrix.os != 'windows-latest'
run: $SCRIPT_DIR/linux-setup.sh $SCRIPT_DIR $DEPS_DIR false
- name: Check manifest.json format
run: |
python "$SCRIPT_DIR/check_manifest_schema.py" \
--manifest_path manifest.json \
--schema_path manifest-schema.json
- name: Check manifest files
run: |
python "$SCRIPT_DIR/check_manifest_files.py" \
--manifest_path manifest.json \
--ci_ignore_path .ciignore
- name: Check manifest feature flags
run: |
python "$SCRIPT_DIR/check_manifest_features.py" \
--manifest_path manifest.json
- name: Check README spec table
run: |
python "$SCRIPT_DIR/check_markdown_table.py" \
--manifest_path manifest.json \
--readme_path README.md
- name: Convert specs to unicode
if: matrix.unicode
run: |
python "$SCRIPT_DIR/unicode_conversion.py" \
--tlauc_path "$DEPS_DIR/tlauc/tlauc" \
--manifest_path manifest.json
- name: Add unicode shims
if: matrix.unicode
run: |
python "$SCRIPT_DIR/unicode_number_set_shim.py" \
--manifest_path manifest.json
- name: Translate PlusCal
# PlusCal translations will be reverted at the end of this step,
# since we want to support people manually editing the generated TLA+
# code in specs they submit as examples. However, running the PlusCal
# translator is currently the only way to ensure that specs contain
# valid PlusCal syntax. So, we have to run the translator and then
# discard the results. However, discarding the results with git reset
# also would discard the Unicode translation. So, only execute this
# step if we did not perform Unicode translation.
if: (!matrix.unicode)
run: |
# https://github.com/tlaplus/tlaplus/issues/906
SKIP=(
"specifications/byzpaxos/BPConProof.tla"
"specifications/byzpaxos/PConProof.tla"
"specifications/byzpaxos/VoteProof.tla"
)
python $SCRIPT_DIR/translate_pluscal.py \
--tools_jar_path $DEPS_DIR/tools/tla2tools.jar \
--manifest_path manifest.json \
--skip "${SKIP[@]}"
git reset --hard HEAD # Restore specs to their original state
- name: Parse all modules
run: |
python $SCRIPT_DIR/parse_modules.py \
--tools_jar_path $DEPS_DIR/tools/tla2tools.jar \
--apalache_path $DEPS_DIR/apalache \
--tlapm_lib_path $DEPS_DIR/tlapm/library \
--community_modules_jar_path $DEPS_DIR/community/modules.jar \
--manifest_path manifest.json
- name: Check small models
run: |
# Need to have a nonempty list to pass as a skip parameter
SKIP=("does/not/exist")
if [ ${{ matrix.unicode }} ]; then
# Apalache does not yet support Unicode
SKIP+=("specifications/EinsteinRiddle/Einstein.cfg")
fi
python $SCRIPT_DIR/check_small_models.py \
--verbose \
--tools_jar_path $DEPS_DIR/tools/tla2tools.jar \
--apalache_path $DEPS_DIR/apalache \
--tlapm_lib_path $DEPS_DIR/tlapm/library \
--community_modules_jar_path $DEPS_DIR/community/modules.jar \
--manifest_path manifest.json \
--skip "${SKIP[@]}"
- name: Smoke-test large models
run: |
# SimKnuthYao requires certain number of states to have been generated
# before termination or else it fails. This makes it not amenable to
# smoke testing.
SKIP=("specifications/KnuthYao/SimKnuthYao.cfg")
# SimTokenRing does not work on Windows systems.
if [[ "${{ matrix.os }}" == "windows-latest" ]]; then
SKIP+=("specifications/ewd426/SimTokenRing.cfg")
fi
python $SCRIPT_DIR/smoke_test_large_models.py \
--verbose \
--tools_jar_path $DEPS_DIR/tools/tla2tools.jar \
--apalache_path $DEPS_DIR/apalache \
--tlapm_lib_path $DEPS_DIR/tlapm/library \
--community_modules_jar_path $DEPS_DIR/community/modules.jar \
--manifest_path manifest.json \
--skip "${SKIP[@]}"
- name: Check proofs
if: matrix.os != 'windows-latest' && !matrix.unicode
run: |
SKIP=(
# Failing; see https://github.com/tlaplus/Examples/issues/67
specifications/Bakery-Boulangerie/Bakery.tla
specifications/Bakery-Boulangerie/Boulanger.tla
specifications/Paxos/Consensus.tla
specifications/PaxosHowToWinATuringAward/Consensus.tla
specifications/lamport_mutex/LamportMutex_proofs.tla
specifications/ewd998/EWD998_proof.tla
specifications/byzpaxos/VoteProof.tla
# Long-running; see https://github.com/tlaplus/tlapm/issues/85
specifications/LoopInvariance/Quicksort.tla
specifications/LoopInvariance/SumSequence.tla
specifications/bcastByz/bcastByz.tla
specifications/MisraReachability/ReachabilityProofs.tla
specifications/byzpaxos/BPConProof.tla # Takes about 30 minutes
)
python $SCRIPT_DIR/check_proofs.py \
--tlapm_path $DEPS_DIR/tlapm-install \
--manifest_path manifest.json \
--skip "${SKIP[@]}"
- name: Smoke-test manifest generation script
run: |
python $SCRIPT_DIR/generate_manifest.py \
--manifest_path manifest.json \
--ci_ignore_path .ciignore
git diff -a