-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hoist CI components into reusable actions and workflows (#122)
* Hoist functional tests into composite action Signed-off-by: Hanno Becker <[email protected]> * Hoist benchmarking into reusable job Signed-off-by: Hanno Becker <[email protected]> * Hoist CI components into reusable workflows Signed-off-by: Hanno Becker <[email protected]> * Add triggerable workflow for CI on EC2 Fixes #118 Signed-off-by: Hanno Becker <[email protected]> * Move reusable workflows into actions Signed-off-by: Hanno Becker <[email protected]> * Reduce nix output Signed-off-by: Hanno Becker <[email protected]> * Address review feedback Signed-off-by: Hanno Becker <[email protected]> --------- Signed-off-by: Hanno Becker <[email protected]>
- Loading branch information
1 parent
bc53aaf
commit e3d21eb
Showing
12 changed files
with
396 additions
and
155 deletions.
There are no files selected for viewing
This file contains 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 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,47 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
name: CBMC | ||
description: Run CBMC proofs for MLKEM-C_AArch64 | ||
|
||
inputs: | ||
use-nix: | ||
description: Whether to run in the default Nix environment | ||
default: true | ||
custom_shell: | ||
description: The shell to use. Only relevant if use-nix is 'false' | ||
default: 'bash' | ||
cross-prefix: | ||
description: Binary prefix for cross compilation | ||
default: '' | ||
runs: | ||
using: composite | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup nix | ||
if: ${{ inputs.use-nix }} | ||
uses: ./.github/actions/setup-nix | ||
with: | ||
devShell: ci-cbmc | ||
script: | | ||
cat >> $GITHUB_STEP_SUMMARY << EOF | ||
## Setup | ||
Architecture: $(uname -m) | ||
- $(nix --version) | ||
- $(cbmc --version) | ||
- litani Version $(litani --version) | ||
- Cadical Version $(cadical --version) | ||
- $(${{ inputs.cross_prefix }}gcc --version | grep -m1 "") | ||
- $(bash --version | grep -m1 "") | ||
EOF | ||
- name: Set shell | ||
shell: bash | ||
run: echo SHELL="${{ inputs.use-nix && 'nix develop .#ci-cbmc -c bash -e {0}' || inputs.custom_shell }}" >> $GITHUB_ENV | ||
- name: Run CBMC proofs | ||
shell: ${{ env.SHELL }} | ||
run: | | ||
cd cbmc/proofs; | ||
echo "::group::cbmc" | ||
KYBER_K=2 ./run-cbmc-proofs.py --summarize; | ||
KYBER_K=3 ./run-cbmc-proofs.py --summarize; | ||
KYBER_K=4 ./run-cbmc-proofs.py --summarize; | ||
echo "::endgroup::" |
This file contains 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,64 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
name: Functional tests | ||
description: Run functional tests for MLKEM-C_AArch64 | ||
|
||
inputs: | ||
use-nix: | ||
description: Whether to run in the default Nix environment | ||
default: true | ||
cflags: | ||
description: CFLAGS to pass to compilation | ||
default: '' | ||
cross-prefix: | ||
description: Binary prefix for cross compilation | ||
default: '' | ||
runs: | ||
using: composite | ||
steps: | ||
- name: Setup nix | ||
uses: ./.github/actions/setup-nix | ||
if: ${{ inputs.use-nix }} | ||
with: | ||
devShell: ci | ||
script: | | ||
ARCH=$(uname -m) | ||
cat >> $GITHUB_STEP_SUMMARY <<-EOF | ||
## Setup | ||
Architecture: $ARCH | ||
- $(uname -a) | ||
- $(nix --version) | ||
- $(${{ inputs.cross-prefix }}gcc --version | grep -m1 "") | ||
- $(bash --version | grep -m1 "") | ||
EOF | ||
- name: Set shell | ||
shell: bash | ||
run: echo SHELL="${{ inputs.use-nix && 'nix develop .#ci -c bash -e {0}' || inputs.custom_shell }}" >> $GITHUB_ENV | ||
- name: Run functional tests | ||
id: func_test | ||
shell: ${{ env.SHELL }} | ||
run: | | ||
echo "::group::func_test" | ||
tests func --cross-prefix=${{ inputs.cross-prefix }} --cflags ${{ inputs.cflags }} -v | ||
echo "::endgroup::" | ||
- name: Run KAT tests | ||
if: | | ||
success() | ||
|| steps.func_test.conclusion == 'failure' | ||
id: kat_test | ||
shell: ${{ env.SHELL }} | ||
run: | | ||
echo "::group::func_test" | ||
tests kat --cross-prefix=${{ inputs.cross-prefix }} --cflags ${{ inputs.cflags }} -v | ||
echo "::endgroup::" | ||
- name: Run Nistkat tests | ||
id: nistkat_test | ||
if: | | ||
success() | ||
|| steps.func_test.conclusion == 'failure' | ||
|| steps.kat_test.conclusion == 'failure' | ||
shell: ${{ env.SHELL }} | ||
run: | | ||
echo "::group::func_test" | ||
tests nistkat --cross-prefix=${{ inputs.cross-prefix }} --cflags ${{ inputs.cflags }} -v | ||
echo "::endgroup::" |
This file contains 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,41 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
name: Lint | ||
description: Lint MLKEM-C_AArch64 | ||
|
||
inputs: | ||
use-nix: | ||
description: Whether to run in the default Nix environment | ||
default: true | ||
custom_shell: | ||
description: The shell to use. Only relevant if use-nix is 'false' | ||
default: 'bash' | ||
cross-prefix: | ||
description: Binary prefix for cross compilation | ||
default: '' | ||
runs: | ||
using: composite | ||
steps: | ||
- name: Setup nix | ||
if: ${{ inputs.use-nix }} | ||
uses: ./.github/actions/setup-nix | ||
with: | ||
devShell: ci-linter | ||
script: | | ||
cat >> $GITHUB_STEP_SUMMARY << EOF | ||
## Setup | ||
Architecture: $(uname -m) | ||
- $(uname -a) | ||
- $(nix --version) | ||
- $(astyle --version) | ||
- $(${{ matrix.target.cross-prefix }}gcc --version | grep -m1 "") | ||
- $(bash --version | grep -m1 "") | ||
EOF | ||
- name: Set shell | ||
shell: bash | ||
run: echo SHELL="${{ inputs.use-nix && 'nix develop .#ci-linter -c bash -e {0}' || inputs.custom_shell }}" >> $GITHUB_ENV | ||
- name: Run linter | ||
shell: ${{ env.SHELL }} | ||
run: | | ||
echo "## Lint & Checks" >> $GITHUB_STEP_SUMMARY | ||
lint |
This file contains 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 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 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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
name: Bench EC2 | ||
on: | ||
workflow_dispatch: | ||
|
This file contains 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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
name: bench-ec2-any | ||
on: | ||
workflow_dispatch: | ||
|
This file contains 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
Oops, something went wrong.