-
Notifications
You must be signed in to change notification settings - Fork 1
52 lines (48 loc) · 1.85 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: Continuous Integration
on:
pull_request:
workflow_dispatch:
inputs:
trigger_docker:
description: "'parsec-openssl-provider-test' if docker build should be triggered"
required: false
default: ""
push:
env:
TEST_DOCKER_IMAGE: ${{ github.event.inputs.trigger_docker || 'ghcr.io/parallaxsecond/parsec-openssl-provider-test' }}
jobs:
build-and-export-test-docker:
runs-on: ubuntu-latest
# For running this job we need to manually trigger the CI and set the variable
if: ${{ github.event.inputs.trigger_docker == 'parsec-openssl-provider-test' }}
steps:
- uses: actions/checkout@v3
- name: Build the docker container
run: pushd tests/docker_image && docker build -t parsec-openssl-provider-test -f parsec-openssl-provider-test.Dockerfile . && popd
- name: Export the docker container
run: docker save parsec-openssl-provider-test > /tmp/parsec-openssl-provider-test.tar
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: parsec-openssl-provider-test
path: /tmp/parsec-openssl-provider-test.tar
build-and-test:
name: Build Parsec OpenSSL Provider and run tests
runs-on: ubuntu-latest
if: ${{ always() }}
needs: [build-and-export-test-docker]
steps:
- uses: actions/checkout@v3
- name: Load Docker
uses: ./.github/actions/load_docker
if: ${{ env.TEST_DOCKER_IMAGE == 'parsec-openssl-provider-test' }}
with:
image-name: "${{ env.TEST_DOCKER_IMAGE }}"
image-path: "/tmp"
- name: Run the container to execute the test script
run:
docker run -v $(pwd):/tmp/parsec-openssl-provider -w /tmp/parsec-openssl-provider -it ${{ env.TEST_DOCKER_IMAGE }} &&
pushd parsec-openssl-provider-shared/ &&
cargo build &&
popd &&
./ci.sh