Skip to content

Commit

Permalink
ci/ci.yml: Redefine jobs in a re-usable way
Browse files Browse the repository at this point in the history
ci.sh has been changed to support the --next-branch-tracking flag.
This flag will not be used in the jobs defined in ci.yml but it
will used in those jobs in a nightly frequency.

 * Set-up base job definitions that are going to be re-used in
   different workflows.
 * Use those re-usable actions in the ci.yml the same way that
   they were being used before.

Signed-off-by: Tomás González <[email protected]>
  • Loading branch information
tgonzalezorlandoarm committed Nov 6, 2023
1 parent 3873e91 commit 387f26c
Show file tree
Hide file tree
Showing 7 changed files with 138 additions and 42 deletions.
20 changes: 20 additions & 0 deletions .github/actions/all_providers/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: "All Providers Tests"
description: "Various tests targeting a Parsec image with all providers included"
inputs:
ci-flags-all-providers:
required: true
description: "Flags with which to run the all providers ci tests"
# ...name, description and inputs as above
runs:
using: "composite"
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"
- 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-all-providers }} all
shell: bash
20 changes: 20 additions & 0 deletions .github/actions/build_all_providers/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: "Build All Providers Tests"
description: "Cargo check all-providers (current Rust stable & old compiler)"
inputs:
ci-flags-all-providers:
required: true
description: "Flags with which to run the build all providers ci tests"
# ...name, description and inputs as above
runs:
using: "composite"
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"
- 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-all-providers }} cargo-check
shell: bash
20 changes: 20 additions & 0 deletions .github/actions/mbed_crypto_provider/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: "Build Mbed Crypto Provider Tests"
description: "Integration tests using Mbed Crypto provider"
inputs:
ci-flags-mbed-crypto-provider:
required: true
description: "Flags with which to run the build Mbed Crypto provider ci tests"
# ...name, description and inputs as above
runs:
using: "composite"
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"
- 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-mbed-crypto-provider }} mbed-crypto
shell: bash
20 changes: 20 additions & 0 deletions .github/actions/pkcs11_provider/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: "PKCS11 Provider Tests"
description: "Integration tests using PKCS 11 provider"
inputs:
ci-flags-pkcs11-provider:
required: true
description: "Flags with which to run the pkcs11 provider ci tests"
# ...name, description and inputs as above
runs:
using: "composite"
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"
- 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-pkcs11-provider }} pkcs11
shell: bash
20 changes: 20 additions & 0 deletions .github/actions/tpm_provider/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: "TPM Provider Tests"
description: "Integration tests using TPM provider"
inputs:
ci-flags-tpm-provider:
required: true
description: "Flags with which to run the tpm provider ci tests"
# ...name, description and inputs as above
runs:
using: "composite"
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"
- 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-tpm-provider }} tpm
shell: bash
20 changes: 20 additions & 0 deletions .github/actions/trusted_service_provider/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: "Trusted Service Provider Tests"
description: "Integration tests using Crypto Trusted Service provider"
inputs:
ci-flags-trusted-service-provider:
required: true
description: "Flags with which to run the trusted service provider ci tests"
# ...name, description and inputs as above
runs:
using: "composite"
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"
- 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-trusted-service-provider }} trusted-service
shell: bash
60 changes: 18 additions & 42 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,10 @@ jobs:
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"
- 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/all_providers
with:
ci-flags-all-providers: ""

build-all-providers:
name: Cargo check all-providers (current Rust stable & old compiler)
Expand All @@ -49,14 +45,10 @@ jobs:
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"
- 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/build_all_providers
with:
ci-flags-all-providers: ""

mbed-crypto-provider:
name: Integration tests using Mbed Crypto provider
Expand All @@ -65,14 +57,10 @@ jobs:
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"
- 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/mbed_crypto_provider
with:
ci-flags-mbed-crypto-provider: ""

pkcs11-provider:
name: Integration tests using PKCS 11 provider
Expand All @@ -81,14 +69,10 @@ jobs:
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"
- 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/pksc11_provider
with:
ci-flags-pkcs11-provider: "--no-stress-test"

tpm-provider:
name: Integration tests using TPM provider
Expand All @@ -97,14 +81,10 @@ jobs:
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"
- 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/tpm_provider
with:
ci-flags-tpm-provider: ""

trusted-service-provider:
name: Integration tests using Crypto Trusted Service provider
Expand All @@ -113,14 +93,10 @@ jobs:
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"
- 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/trusted_service_provider
with:
ci-flags-trusted-service-provider: ""

cryptoauthlib-provider:
name: Integration tests using CryptoAuthentication Library provider
Expand Down

0 comments on commit 387f26c

Please sign in to comment.