|
5 | 5 | pull_request:
|
6 | 6 | workflow_dispatch:
|
7 | 7 | inputs:
|
8 |
| - trigger_docker: |
| 8 | + trigger_test_all_docker: |
9 | 9 | description: "'parsec-service-test-all' if docker build should be triggered"
|
10 | 10 | required: false
|
11 | 11 | default: ""
|
| 12 | + trigger_test_cross_docker: |
| 13 | + description: "'parsec-service-test-cross-compile' if docker build should be triggered" |
| 14 | + required: false |
| 15 | + default: "" |
12 | 16 |
|
13 | 17 | env:
|
14 |
| - TEST_ALL_DOCKER_IMAGE: ${{ github.event.inputs.trigger_docker || 'ghcr.io/parallaxsecond/parsec-service-test-all' }} |
| 18 | + TEST_ALL_DOCKER_IMAGE: ${{ github.event.inputs.trigger_test_all_docker || 'ghcr.io/parallaxsecond/parsec-service-test-all' }} |
| 19 | + TEST_CROSS_DOCKER_IMAGE: ${{ github.event.inputs.trigger_test_cross_docker || 'ghcr.io/parallaxsecond/parsec-service-test-cross-compile' }} |
15 | 20 |
|
16 | 21 | jobs:
|
17 | 22 | build-and-export-test-all-docker:
|
18 | 23 | runs-on: ubuntu-latest
|
19 | 24 | # For running this job we need to manually trigger the CI and set the variable
|
20 |
| - if: ${{ github.event.inputs.trigger_docker == 'parsec-service-test-all' }} |
| 25 | + if: ${{ github.event.inputs.trigger_test_all_docker == 'parsec-service-test-all' }} |
21 | 26 | steps:
|
22 | 27 | - uses: actions/checkout@v3
|
23 |
| - - name: Build the docker container |
24 |
| - run: pushd e2e_tests/docker_image && docker build -t parsec-service-test-all -f parsec-service-test-all.Dockerfile . && popd |
25 |
| - - name: Export the docker container |
26 |
| - run: docker save parsec-service-test-all > /tmp/parsec-service-test-all.tar |
27 |
| - - name: Upload artifact |
28 |
| - uses: actions/upload-artifact@v3 |
| 28 | + - name: Build and Export Docker Image |
| 29 | + uses: ./.github/actions/build_export_docker |
29 | 30 | with:
|
30 |
| - name: parsec-service-test-all |
31 |
| - path: /tmp/parsec-service-test-all.tar |
| 31 | + image-name: "parsec-service-test-all" |
| 32 | + |
| 33 | + build-and-export-cross-compile-docker: |
| 34 | + runs-on: ubuntu-latest |
| 35 | + # For running this job we need to manually trigger the CI and set the variable |
| 36 | + if: ${{ github.event.inputs.trigger_test_cross_docker == 'parsec-service-test-cross-compile' }} |
| 37 | + steps: |
| 38 | + - uses: actions/checkout@v3 |
| 39 | + - name: Build and Export Docker Image |
| 40 | + uses: ./.github/actions/build_export_docker |
| 41 | + with: |
| 42 | + image-name: "parsec-service-test-cross-compile" |
32 | 43 |
|
33 | 44 | all-providers:
|
34 | 45 | name: Various tests targeting a Parsec image with all providers included
|
@@ -165,13 +176,22 @@ jobs:
|
165 | 176 | # Currently only the Mbed Crypto, PKCS 11, and TPM providers are tested as the other ones need to cross-compile other libraries.
|
166 | 177 | name: Cross-compile Parsec to various targets
|
167 | 178 | runs-on: ubuntu-latest
|
| 179 | + if: ${{ always() }} |
| 180 | + needs: [build-and-export-cross-compile-docker] |
168 | 181 | steps:
|
169 |
| - - uses: actions/checkout@v2 |
170 |
| - - name: Run the container to execute the test script |
171 |
| - run: |
172 |
| - docker run -v $(pwd):/tmp/parsec -w /tmp/parsec ghcr.io/parallaxsecond/parsec-service-test-cross-compile /tmp/parsec/test/cross-compile.sh |
173 |
| - # When running the container built on the CI |
174 |
| - # run: docker run -v $(pwd):/tmp/parsec -w /tmp/parsec -t parsec-service-test-cross-compile /tmp/parsec/test/cross-compile.sh |
| 182 | + - uses: actions/checkout@v3 |
| 183 | + - name: Load Docker |
| 184 | + uses: ./.github/actions/load_docker |
| 185 | + if: ${{ env.TEST_CROSS_DOCKER_IMAGE == 'parsec-service-test-cross-compile' }} |
| 186 | + with: |
| 187 | + image-name: "${{ env.TEST_CROSS_DOCKER_IMAGE }}" |
| 188 | + image-path: "/tmp" |
| 189 | + - name: Run the cross compiler tests using pre-built docker image |
| 190 | + if: ${{ env.TEST_CROSS_DOCKER_IMAGE != 'parsec-service-test-cross-compile' }} |
| 191 | + run: docker run -v $(pwd):/tmp/parsec -w /tmp/parsec ghcr.io/parallaxsecond/parsec-service-test-cross-compile /tmp/parsec/test/cross-compile.sh |
| 192 | + - name: Run the cross compiler tests using image built on the CI |
| 193 | + if: ${{ env.TEST_CROSS_DOCKER_IMAGE == 'parsec-service-test-cross-compile' }} |
| 194 | + run: docker run -v $(pwd):/tmp/parsec -w "${{ env.TEST_CROSS_DOCKER_IMAGE }}" /tmp/parsec/test/cross-compile.sh |
175 | 195 |
|
176 | 196 | links:
|
177 | 197 | name: Check links
|
|
0 commit comments