From 84b1ae9c1533ef565a216d7d7cee56cd22c74270 Mon Sep 17 00:00:00 2001 From: Matt Davis Date: Mon, 12 Jul 2021 11:30:39 +0100 Subject: [PATCH] Split out the all-providers build test into its own CI job. Signed-off-by: Matt Davis --- .github/workflows/ci.yml | 13 +++++++++++++ ci.sh | 15 +++++++++++---- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 56ec25e3..4d1b29a6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,6 +16,19 @@ jobs: # When running the container built on the CI # run: docker run -v $(pwd):/tmp/parsec -w /tmp/parsec -t parsec-service-test-all /tmp/parsec/ci.sh all + build-all-providers: + name: Cargo check all-providers (current Rust stable & old compiler) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + # Use the following step when updating the `parsec-service-test-all` image + # - name: Build the container + # run: pushd e2e_tests/docker_image && docker build -t parsec-service-test-all -f parsec-service-test-all.Dockerfile . && popd + - name: Run the container to execute the test script + run: docker run -v $(pwd):/tmp/parsec -w /tmp/parsec ghcr.io/parallaxsecond/parsec-service-test-all /tmp/parsec/ci.sh cargo-check + # When running the container built on the CI + # run: docker run -v $(pwd):/tmp/parsec -w /tmp/parsec -t parsec-service-test-all /tmp/parsec/ci.sh cargo-check + mbed-crypto-provider: name: Integration tests using Mbed Crypto provider runs-on: ubuntu-latest diff --git a/ci.sh b/ci.sh index 5bcd0f2c..c5fc5e60 100755 --- a/ci.sh +++ b/ci.sh @@ -117,13 +117,18 @@ while [ "$#" -gt 0 ]; do --no-stress-test ) NO_STRESS_TEST="True" ;; - mbed-crypto | pkcs11 | tpm | trusted-service | cryptoauthlib | all) + mbed-crypto | pkcs11 | tpm | trusted-service | cryptoauthlib | all | cargo-check) if [ -n "$PROVIDER_NAME" ]; then error_msg "Only one provider name must be given" fi PROVIDER_NAME=$1 - cp $(pwd)/e2e_tests/provider_cfg/$1/config.toml $CONFIG_PATH - if [ "$PROVIDER_NAME" = "all" ]; then + + # If running anything but cargo-check, copy config + if [ "$PROVIDER_NAME" != "cargo-check" ]; then + cp $(pwd)/e2e_tests/provider_cfg/$1/config.toml $CONFIG_PATH + fi + + if [ "$PROVIDER_NAME" = "all" ] || [ "$PROVIDER_NAME" = "cargo-check" ]; then FEATURES="--features=all-providers,all-authenticators" TEST_FEATURES="--features=all-providers" else @@ -245,7 +250,7 @@ fi echo "Build test" -if [ "$PROVIDER_NAME" = "all" ]; then +if [ "$PROVIDER_NAME" = "cargo-check" ]; then # We test that everything in the service still builds with the current Rust stable # and an old Rust compiler. # The old Rust compiler version is found by manually checking the oldest Rust version of all @@ -278,6 +283,8 @@ if [ "$PROVIDER_NAME" = "all" ]; then RUST_BACKTRACE=1 cargo check --features="unix-peer-credentials-authenticator" RUST_BACKTRACE=1 cargo check --features="jwt-svid-authenticator" RUST_BACKTRACE=1 cargo check --features="all-authenticators" + + exit 0 fi RUST_BACKTRACE=1 cargo build $FEATURES