-
Notifications
You must be signed in to change notification settings - Fork 212
Added CI step to check proofs #68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
1dd1f08
Added simple script to check proofs
ahelwer 9e5eb3b
Parameterized check proofs script
ahelwer 4625273
Cache proof fingerprints in github actions
ahelwer 37702de
Move proof check step last in CI
ahelwer 56ca60f
Use cache restore key to store proof fingerprints
ahelwer 3c74a0a
Restored TLAPS.tla files
ahelwer c1e506b
Added TLAPS.tla files to manifest
ahelwer 090e9a3
Remove fingerprint cache
ahelwer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| """ | ||
| Validate all proofs in all modules with TLAPM. | ||
| """ | ||
|
|
||
| from argparse import ArgumentParser | ||
| from os.path import dirname, join, normpath | ||
| import subprocess | ||
| from timeit import default_timer as timer | ||
| import tla_utils | ||
|
|
||
| parser = ArgumentParser(description='Validate all proofs in all modules with TLAPM.') | ||
| parser.add_argument('--tlapm_path', help='Path to TLAPM install dir; should have bin and lib subdirs', required=True) | ||
| parser.add_argument('--manifest_path', help='Path to the tlaplus/examples manifest.json file', required=True) | ||
| args = parser.parse_args() | ||
|
|
||
| tlapm_path = normpath(args.tlapm_path) | ||
| manifest_path = normpath(args.manifest_path) | ||
| manifest = tla_utils.load_json(manifest_path) | ||
| examples_root = dirname(manifest_path) | ||
|
|
||
| # Tracked in https://github.com/tlaplus/Examples/issues/67 | ||
| failing_proofs = [ | ||
| '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' | ||
| ] | ||
|
|
||
| # Fingerprint issues; tracked in https://github.com/tlaplus/tlapm/issues/85 | ||
| long_running_proofs = [ | ||
| 'specifications/LoopInvariance/Quicksort.tla', | ||
| 'specifications/LoopInvariance/SumSequence.tla', | ||
| 'specifications/bcastByz/bcastByz.tla', | ||
| 'specifications/MisraReachability/ReachabilityProofs.tla' | ||
| ] | ||
|
|
||
| proof_module_paths = [ | ||
| module['path'] | ||
| for spec in manifest['specifications'] | ||
| for module in spec['modules'] | ||
| if 'proof' in module['features'] | ||
| and module['path'] not in failing_proofs | ||
| and module['path'] not in long_running_proofs | ||
| ] | ||
|
|
||
| success = True | ||
| tlapm_path = join(tlapm_path, 'bin', 'tlapm') | ||
| for module_path in proof_module_paths: | ||
| print(module_path) | ||
| start_time = timer() | ||
| module_path = tla_utils.from_cwd(examples_root, module_path) | ||
| module_dir = dirname(module_path) | ||
| tlapm = subprocess.run( | ||
| [ | ||
| tlapm_path, module_path, | ||
| '-I', module_dir | ||
| ], capture_output=True | ||
| ) | ||
| end_time = timer() | ||
| print(f'Checked proofs in {end_time - start_time:.1f}s') | ||
| if tlapm.returncode != 0: | ||
| print('FAILURE') | ||
| print(tlapm.stderr.decode('utf-8')) | ||
| success = False | ||
|
|
||
| exit(0 if success else 1) | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.