| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
name: CBMC |
| 6 |
description: Run CBMC proofs for mldsa-native |
| 7 |
|
| 8 |
inputs: |
| 9 |
nix-shell: |
| 10 |
description: Run in the specified Nix environment if exists |
| 11 |
default: "ci-cbmc" |
| 12 |
nix-cache: |
| 13 |
description: Determine whether to enable nix cache |
| 14 |
default: 'true' |
| 15 |
nix-verbose: |
| 16 |
description: Determine wether to suppress nix log or not |
| 17 |
default: 'false' |
| 18 |
custom_shell: |
| 19 |
description: The shell to use. Only relevant if use-nix is 'false' |
| 20 |
default: "bash" |
| 21 |
mldsa_parameter_set: |
| 22 |
description: "Security level for ML-DSA (2,3,5)" |
| 23 |
default: "2" |
| 24 |
gh_token: |
| 25 |
description: Github access token to use |
| 26 |
required: true |
| 27 |
runs: |
| 28 |
using: composite |
| 29 |
steps: |
| 30 |
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 |
| 31 |
- uses: ./.github/actions/setup-shell |
| 32 |
with: |
| 33 |
nix-shell: ${{ inputs.nix-shell }} |
| 34 |
nix-cache: ${{ inputs.nix-cache }} |
| 35 |
nix-verbose: ${{ inputs.nix-verbose }} |
| 36 |
gh_token: ${{ inputs.gh_token }} |
| 37 |
custom_shell: ${{ inputs.custom_shell }} |
| 38 |
script: | |
| 39 |
|
| 40 |
if [[ ${{ inputs.nix-shell }} != '' ]]; then |
| 41 |
nix-collect-garbage |
| 42 |
fi |
| 43 |
|
| 44 |
cat >> $GITHUB_STEP_SUMMARY << EOF |
| 45 |
## Setup |
| 46 |
Architecture: $(uname -m) |
| 47 |
- $(nix --version) |
| 48 |
- $(cbmc --version) |
| 49 |
- litani Version $(litani --version) |
| 50 |
- Cadical Version $(cadical --version) |
| 51 |
- $(bash --version | grep -m1 "") |
| 52 |
EOF |
| 53 |
- name: Run CBMC proofs (MLD_CONFIG_PARAMETER_SET=${{ inputs.mldsa_parameter_set }}) |
| 54 |
shell: ${{ env.SHELL }} |
| 55 |
env: |
| 56 |
GH_TOKEN: ${{ inputs.gh_token }} |
| 57 |
run: | |
| 58 |
echo "::group::cbmc_${{ inputs.mldsa_parameter_set }}" |
| 59 |
tests cbmc --mldsa-parameter-set ${{ inputs.mldsa_parameter_set }} --per-proof-timeout 1800 --output-result-json ${{ github.workspace }}/cbmc_result_${{ inputs.mldsa_parameter_set }}.json || cbmc_failed=true |
| 60 |
echo "::endgroup::" |
| 61 |
python3 ${{ github.action_path }}/report.py \ |
| 62 |
--results-json "${{ github.workspace }}/cbmc_result_${{ inputs.mldsa_parameter_set }}.json" \ |
| 63 |
--mldsa-parameter-set "${{ inputs.mldsa_parameter_set }}" \ |
| 64 |
--min-runtime 20 \ |
| 65 |
--regression-threshold 1.5 \ |
| 66 |
--gh-pages-branch gh-pages \ |
| 67 |
--data-dir dev/cbmc |
| 68 |
if [ "$cbmc_failed" = "true" ]; then exit 1; fi |