Skip to content
This repository has been archived by the owner on Jan 2, 2023. It is now read-only.

Update to polkadot-v0.9.28 base #68

Merged
merged 9 commits into from
Sep 20, 2022
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
92 changes: 63 additions & 29 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,16 @@ jobs:
strategy:
fail-fast: false
matrix:
mode: [ sidechain, offchain-worker, teeracle ]
include:
- flavor_id: sidechain
mode: sidechain
- flavor_id: offchain-worker
mode: offchain-worker
- flavor_id: teeracle
mode: teeracle
- flavor_id: sidechain-evm
mode: sidechain
additional_features: evm

steps:
- uses: actions/checkout@v3
Expand All @@ -62,39 +71,41 @@ jobs:
env:
DOCKER_BUILDKIT: 1
run: >
docker build -t integritee-worker-${{ matrix.mode }}-${{ github.sha }}
--target deployed-worker --build-arg WORKER_MODE_ARG=${{ matrix.mode }}
docker build -t integritee-worker-${{ matrix.flavor_id }}-${{ github.sha }}
--target deployed-worker
--build-arg WORKER_MODE_ARG=${{ matrix.mode }} --build-arg ADDITIONAL_FEATURES_ARG=${{ matrix.additional_features }}
-f build.Dockerfile .

- name: Build CLI client
env:
DOCKER_BUILDKIT: 1
run: >
docker build -t integritee-cli-client-${{ matrix.mode }}-${{ github.sha }}
--target deployed-client --build-arg WORKER_MODE_ARG=${{ matrix.mode }}
docker build -t integritee-cli-client-${{ matrix.flavor_id }}-${{ github.sha }}
--target deployed-client
--build-arg WORKER_MODE_ARG=${{ matrix.mode }} --build-arg ADDITIONAL_FEATURES_ARG=${{ matrix.additional_features }}
-f build.Dockerfile .

- run: docker images --all

- name: Test Enclave # cargo test is not supported in the enclave, see: https://github.com/apache/incubator-teaclave-sgx-sdk/issues/232
run: docker run --name ${{ env.BUILD_CONTAINER_NAME }} integritee-worker-${{ matrix.mode }}-${{ github.sha }} test --all
run: docker run --name ${{ env.BUILD_CONTAINER_NAME }} integritee-worker-${{ matrix.flavor_id }}-${{ github.sha }} test --all

- name: Export worker image(s)
run: |
docker image save integritee-worker-${{ matrix.mode }}-${{ github.sha }} | gzip > integritee-worker-${{ matrix.mode }}-${{ github.sha }}.tar.gz
docker image save integritee-cli-client-${{ matrix.mode }}-${{ github.sha }} | gzip > integritee-cli-client-${{ matrix.mode }}-${{ github.sha }}.tar.gz
docker image save integritee-worker-${{ matrix.flavor_id }}-${{ github.sha }} | gzip > integritee-worker-${{ matrix.flavor_id }}-${{ github.sha }}.tar.gz
docker image save integritee-cli-client-${{ matrix.flavor_id }}-${{ github.sha }} | gzip > integritee-cli-client-${{ matrix.flavor_id }}-${{ github.sha }}.tar.gz

- name: Upload worker image
uses: actions/upload-artifact@v2
with:
name: integritee-worker-${{ matrix.mode }}-${{ github.sha }}.tar.gz
path: integritee-worker-${{ matrix.mode }}-${{ github.sha }}.tar.gz
name: integritee-worker-${{ matrix.flavor_id }}-${{ github.sha }}.tar.gz
path: integritee-worker-${{ matrix.flavor_id }}-${{ github.sha }}.tar.gz

- name: Upload CLI client image
uses: actions/upload-artifact@v2
with:
name: integritee-cli-client-${{ matrix.mode }}-${{ github.sha }}.tar.gz
path: integritee-cli-client-${{ matrix.mode }}-${{ github.sha }}.tar.gz
name: integritee-cli-client-${{ matrix.flavor_id }}-${{ github.sha }}.tar.gz
path: integritee-cli-client-${{ matrix.flavor_id }}-${{ github.sha }}.tar.gz

clippy:
runs-on: ubuntu-latest
Expand All @@ -105,11 +116,31 @@ jobs:
# enclave is not in the same workspace
run: rustup show && cd enclave-runtime && rustup show

- name: Worker & Client
- name: Clippy default features
run: cargo clippy -- -D warnings
- name: Enclave # Enclave is separate as it's not in the workspace
run: cd enclave-runtime && cargo clippy -- -D warnings

- name: Clippy with EVM feature
run: |
cargo clippy --features evm -- -D warnings
cd enclave-runtime && cargo clippy --features evm -- -D warnings

- name: Clippy with Sidechain feature
run: |
cargo clippy --features sidechain -- -D warnings
cd enclave-runtime && cargo clippy --features sidechain -- -D warnings

- name: Clippy with Teeracle feature
run: |
cargo clippy --features teeracle -- -D warnings
cd enclave-runtime && cargo clippy --features teeracle -- -D warnings

- name: Clippy with Offchain-worker feature
run: |
cargo clippy --features offchain-worker -- -D warnings
cd enclave-runtime && cargo clippy --features offchain-worker -- -D warnings

- name: Fail-fast; cancel other jobs
if: failure()
uses: andymckay/[email protected]
Expand Down Expand Up @@ -146,28 +177,31 @@ jobs:
matrix:
include:
- test: M6
mode: sidechain
flavor_id: sidechain
demo_name: demo-indirect-invocation
- test: M8
mode: sidechain
flavor_id: sidechain
demo_name: demo-direct-call
- test: Sidechain
mode: sidechain
flavor_id: sidechain
demo_name: demo-sidechain
- test: M6
mode: offchain-worker
flavor_id: offchain-worker
demo_name: demo-indirect-invocation
- test: Teeracle
mode: teeracle
flavor_id: teeracle
demo_name: demo-teeracle
- test: Benchmark
mode: sidechain
flavor_id: sidechain
demo_name: sidechain-benchmark
- test: EVM
flavor_id: sidechain-evm
demo_name: demo-smart-contract
- test: Litentry-user-shielding-key
mode: sidechain
flavor_id: sidechain
demo_name: user-shielding-key
- test: HTTPSTest
mode: sidechain
flavor_id: sidechain
demo_name: https-test

steps:
Expand All @@ -188,35 +222,35 @@ jobs:
- name: Download Worker Image
uses: actions/download-artifact@v2
with:
name: integritee-worker-${{ matrix.mode }}-${{ github.sha }}.tar.gz
name: integritee-worker-${{ matrix.flavor_id }}-${{ github.sha }}.tar.gz
path: .

- name: Download CLI client Image
uses: actions/download-artifact@v2
with:
name: integritee-cli-client-${{ matrix.mode }}-${{ github.sha }}.tar.gz
name: integritee-cli-client-${{ matrix.flavor_id }}-${{ github.sha }}.tar.gz
path: .

- name: Load Worker & Client Images
env:
DOCKER_BUILDKIT: 1
run: |
docker image load --input integritee-worker-${{ matrix.mode }}-${{ github.sha }}.tar.gz
docker image load --input integritee-cli-client-${{ matrix.mode }}-${{ github.sha }}.tar.gz
docker image load --input integritee-worker-${{ matrix.flavor_id }}-${{ github.sha }}.tar.gz
docker image load --input integritee-cli-client-${{ matrix.flavor_id }}-${{ github.sha }}.tar.gz
docker images --all

- name: Re-name Image Tags
run: |
docker tag integritee-worker-${{ matrix.mode }}-${{ github.sha }} ${{ env.WORKER_IMAGE_TAG }}
docker tag integritee-cli-client-${{ matrix.mode }}-${{ github.sha }} ${{ env.CLIENT_IMAGE_TAG }}
docker tag integritee-worker-${{ matrix.flavor_id }}-${{ github.sha }} ${{ env.WORKER_IMAGE_TAG }}
docker tag integritee-cli-client-${{ matrix.flavor_id }}-${{ github.sha }} ${{ env.CLIENT_IMAGE_TAG }}
docker images --all

- name: Build litentry parachain docker images
run: |
cd docker
docker-compose -f litentry-parachain.build.yml build

- name: Integration Test ${{ matrix.test }}-${{ matrix.mode }}
- name: Integration Test ${{ matrix.test }}-${{ matrix.flavor_id }}
timeout-minutes: 30
run: |
cd docker
Expand All @@ -235,7 +269,7 @@ jobs:
if: always()
uses: actions/upload-artifact@v2
with:
name: logs-${{ matrix.test }}-${{ matrix.mode }}
name: logs-${{ matrix.test }}-${{ matrix.flavor_id }}
path: ./${{ env.LOG_DIR }}

# Only push docker image when tests are passed on dev branch
Expand Down
Loading