Skip to content

Track and test dependencies' 'next' branch #732

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 5 commits into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/actions/ci_script/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: "Run CI Tests"
description: "Run the ci.sh script with the specified flags"
inputs:
ci-flags:
required: true
description: "Flags with which to run the ci.sh tests"

runs:
using: "composite"
steps:
- name: Load Docker
uses: ./.github/actions/load_docker
if: ${{ env.TEST_ALL_DOCKER_IMAGE == 'parsec-service-test-all' }}
with:
image-name: "${{ env.TEST_ALL_DOCKER_IMAGE }}"
image-path: "/tmp"
- name: Run the container to execute the test script
run: docker run -v $(pwd):/tmp/parsec -w /tmp/parsec -t ${{ env.TEST_ALL_DOCKER_IMAGE }} /tmp/parsec/ci.sh ${{ inputs.ci-flags }}
shell: bash
2 changes: 1 addition & 1 deletion .github/actions/load_docker/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ inputs:
image-path:
required: true
description: "Path to save the docker image"
# ...name, description and inputs as above

runs:
using: "composite"
steps:
Expand Down
96 changes: 32 additions & 64 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,111 +36,83 @@ jobs:
if: ${{ always() }}
needs: [build-and-export-test-all-docker]
steps:
- uses: actions/checkout@v2
- name: Load Docker
uses: ./.github/actions/load_docker
if: ${{ env.TEST_ALL_DOCKER_IMAGE == 'parsec-service-test-all' }}
with:
image-name: "${{ env.TEST_ALL_DOCKER_IMAGE }}"
image-path: "/tmp"
- uses: actions/checkout@v3
- name: Run the container to execute the test script
run: docker run -v $(pwd):/tmp/parsec -w /tmp/parsec -t ${{ env.TEST_ALL_DOCKER_IMAGE }} /tmp/parsec/ci.sh all
uses: ./.github/actions/ci_script
with:
ci-flags: "all"

build-all-providers:
name: Cargo check all-providers (current Rust stable & old compiler)
runs-on: ubuntu-latest
if: ${{ always() }}
needs: [build-and-export-test-all-docker]
steps:
- uses: actions/checkout@v2
- name: Load Docker
uses: ./.github/actions/load_docker
if: ${{ env.TEST_ALL_DOCKER_IMAGE == 'parsec-service-test-all' }}
with:
image-name: "${{ env.TEST_ALL_DOCKER_IMAGE }}"
image-path: "/tmp"
- uses: actions/checkout@v3
- name: Run the container to execute the test script
run: docker run -v $(pwd):/tmp/parsec -w /tmp/parsec -t ${{ env.TEST_ALL_DOCKER_IMAGE }} /tmp/parsec/ci.sh cargo-check
uses: ./.github/actions/ci_script
with:
ci-flags: "cargo-check"

mbed-crypto-provider:
name: Integration tests using Mbed Crypto provider
runs-on: ubuntu-latest
if: ${{ always() }}
needs: [build-and-export-test-all-docker]
steps:
- uses: actions/checkout@v2
- name: Load Docker
uses: ./.github/actions/load_docker
if: ${{ env.TEST_ALL_DOCKER_IMAGE == 'parsec-service-test-all' }}
with:
image-name: "${{ env.TEST_ALL_DOCKER_IMAGE }}"
image-path: "/tmp"
- uses: actions/checkout@v3
- name: Run the container to execute the test script
run: docker run -v $(pwd):/tmp/parsec -w /tmp/parsec -t ${{ env.TEST_ALL_DOCKER_IMAGE }} /tmp/parsec/ci.sh mbed-crypto
uses: ./.github/actions/ci_script
with:
ci-flags: "mbed-crypto"

pkcs11-provider:
name: Integration tests using PKCS 11 provider
runs-on: ubuntu-latest
if: ${{ always() }}
needs: [build-and-export-test-all-docker]
steps:
- uses: actions/checkout@v2
- name: Load Docker
uses: ./.github/actions/load_docker
if: ${{ env.TEST_ALL_DOCKER_IMAGE == 'parsec-service-test-all' }}
with:
image-name: "${{ env.TEST_ALL_DOCKER_IMAGE }}"
image-path: "/tmp"
- uses: actions/checkout@v3
- name: Run the container to execute the test script
run: docker run -v $(pwd):/tmp/parsec -w /tmp/parsec -t ${{ env.TEST_ALL_DOCKER_IMAGE }} /tmp/parsec/ci.sh pkcs11 --no-stress-test
uses: ./.github/actions/ci_script
with:
ci-flags: "pkcs11 --no-stress-test"

tpm-provider:
name: Integration tests using TPM provider
runs-on: ubuntu-latest
if: ${{ always() }}
needs: [build-and-export-test-all-docker]
steps:
- uses: actions/checkout@v2
- name: Load Docker
uses: ./.github/actions/load_docker
if: ${{ env.TEST_ALL_DOCKER_IMAGE == 'parsec-service-test-all' }}
with:
image-name: "${{ env.TEST_ALL_DOCKER_IMAGE }}"
image-path: "/tmp"
- uses: actions/checkout@v3
- name: Run the container to execute the test script
run: docker run -v $(pwd):/tmp/parsec -w /tmp/parsec -t ${{ env.TEST_ALL_DOCKER_IMAGE }} /tmp/parsec/ci.sh tpm
uses: ./.github/actions/ci_script
with:
ci-flags: "tpm"

trusted-service-provider:
name: Integration tests using Crypto Trusted Service provider
runs-on: ubuntu-latest
if: ${{ always() }}
needs: [build-and-export-test-all-docker]
steps:
- uses: actions/checkout@v2
- name: Load Docker
uses: ./.github/actions/load_docker
if: ${{ env.TEST_ALL_DOCKER_IMAGE == 'parsec-service-test-all' }}
with:
image-name: "${{ env.TEST_ALL_DOCKER_IMAGE }}"
image-path: "/tmp"
- uses: actions/checkout@v3
- name: Run the container to execute the test script
run: docker run -v $(pwd):/tmp/parsec -w /tmp/parsec -t ${{ env.TEST_ALL_DOCKER_IMAGE }} /tmp/parsec/ci.sh trusted-service
uses: ./.github/actions/ci_script
with:
ci-flags: "trusted-service"

cryptoauthlib-provider:
name: Integration tests using CryptoAuthentication Library provider
runs-on: ubuntu-latest
if: ${{ always() }}
needs: [build-and-export-test-all-docker]
steps:
- uses: actions/checkout@v2
- name: Load Docker
uses: ./.github/actions/load_docker
if: ${{ env.TEST_ALL_DOCKER_IMAGE == 'parsec-service-test-all' }}
with:
image-name: "${{ env.TEST_ALL_DOCKER_IMAGE }}"
image-path: "/tmp"
- uses: actions/checkout@v3
- name: Run the container to execute the test script
run: docker run -v $(pwd):/tmp/parsec -w /tmp/parsec -t ${{ env.TEST_ALL_DOCKER_IMAGE }} /tmp/parsec/ci.sh cryptoauthlib --no-stress-test
uses: ./.github/actions/ci_script
with:
ci-flags: "cryptoauthlib --no-stress-test"

fuzz-test-checker:
name: Check that the fuzz testing framework is still working
Expand Down Expand Up @@ -170,15 +142,11 @@ jobs:
if: ${{ always() }}
needs: [build-and-export-test-all-docker]
steps:
- uses: actions/checkout@v2
- name: Load Docker
uses: ./.github/actions/load_docker
if: ${{ env.TEST_ALL_DOCKER_IMAGE == 'parsec-service-test-all' }}
with:
image-name: "${{ env.TEST_ALL_DOCKER_IMAGE }}"
image-path: "/tmp"
- uses: actions/checkout@v3
- name: Run the container to execute the test script
run: docker run -v $(pwd):/tmp/parsec -w /tmp/parsec -t ${{ env.TEST_ALL_DOCKER_IMAGE }} /tmp/parsec/ci.sh on-disk-kim
uses: ./.github/actions/ci_script
with:
ci-flags: "on-disk-kim"

cross-compilation:
# Currently only the Mbed Crypto, PKCS 11, and TPM providers are tested as the other ones need to cross-compile other libraries.
Expand Down
89 changes: 89 additions & 0 deletions .github/workflows/nightly-next.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: Nightly Next Branch Checks

on:
schedule:
# Every night at midnight
- cron: "0 0 * * *"
workflow_dispatch:
inputs:
rev:
description: "Revision hash to run against"
required: false
default: ""


env:
TEST_ALL_DOCKER_IMAGE: 'ghcr.io/parallaxsecond/parsec-service-test-all'

jobs:
all-providers:
name: Various tests targeting a Parsec image with all providers included
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: "${{ github.event.inputs.rev }}"
- name: Run the container to execute the test script
uses: ./.github/actions/ci_script
with:
ci-flags: "all --test-next-branch-tracking"

build-all-providers:
name: Cargo check all-providers (current Rust stable & old compiler)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: "${{ github.event.inputs.rev }}"
- name: Run the container to execute the test script
uses: ./.github/actions/ci_script
with:
ci-flags: "cargo-check --test-next-branch-tracking"

mbed-crypto-provider:
name: Integration tests using Mbed Crypto provider
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: "${{ github.event.inputs.rev }}"
- name: Run the container to execute the test script
uses: ./.github/actions/ci_script
with:
ci-flags: "mbed-crypto --test-next-branch-tracking"

pkcs11-provider:
name: Integration tests using PKCS 11 provider
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: "${{ github.event.inputs.rev }}"
- name: Run the container to execute the test script
uses: ./.github/actions/ci_script
with:
ci-flags: "pkcs11 --no-stress-test --test-next-branch-tracking"

tpm-provider:
name: Integration tests using TPM provider
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: "${{ github.event.inputs.rev }}"
- name: Run the container to execute the test script
uses: ./.github/actions/ci_script
with:
ci-flags: "tpm --test-next-branch-tracking"

trusted-service-provider:
name: Integration tests using Crypto Trusted Service provider
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: "${{ github.event.inputs.rev }}"
- name: Run the container to execute the test script
uses: ./.github/actions/ci_script
with:
ci-flags: "trusted-service --test-next-branch-tracking"
13 changes: 13 additions & 0 deletions ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ MSRV=1.66.0
NO_CARGO_CLEAN=
NO_STRESS_TEST=
PROVIDER_NAME=
TEST_NEXT_BRANCH_TRACKING=
CONFIG_PATH=$(pwd)/e2e_tests/provider_cfg/tmp_config.toml
while [ "$#" -gt 0 ]; do
case "$1" in
Expand All @@ -171,6 +172,9 @@ while [ "$#" -gt 0 ]; do
--no-stress-test )
NO_STRESS_TEST="True"
;;
--test-next-branch-tracking )
TEST_NEXT_BRANCH_TRACKING="True"
;;
mbed-crypto | pkcs11 | tpm | trusted-service | cryptoauthlib | all | cargo-check | on-disk-kim)
if [ -n "$PROVIDER_NAME" ]; then
error_msg "Only one provider name must be given"
Expand Down Expand Up @@ -206,6 +210,15 @@ while [ "$#" -gt 0 ]; do
shift
done

if [ "$TEST_NEXT_BRANCH_TRACKING" ]; then
echo "Track next branches for parallaxsecond repositories"
python3 $(pwd)/utils/release_tracking.py $(pwd)/Cargo.toml $(pwd)/e2e_tests/Cargo.toml
next_branch_result=$?
if [ "$next_branch_result" -ne 0 ]; then
error_msg "Failed to track next branches of parallaxsecond repositories."
fi
fi

# Check if the PROVIDER_NAME was given.
if [ -z "$PROVIDER_NAME" ]; then
error_msg "a provider name needs to be given as input argument to that script."
Expand Down
2 changes: 1 addition & 1 deletion utils/dependency_cross_matcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def run_cargo_tree(path):
cmd += '--features tss-esapi/generate-bindings,cryptoki/generate-bindings -d'
prev_dir = os.getcwd()
os.chdir(os.path.join(path))
return subprocess.check_output(cmd.split(' ')).decode()
return subprocess.check_output(cmd, shell=True).decode()


def run_deps_mismatcher(lines):
Expand Down
Loading