Skip to content

Commit

Permalink
Merge branch 'dev' into release-v0.9.17
Browse files Browse the repository at this point in the history
  • Loading branch information
Kailai-Wang committed Jan 31, 2024
2 parents 67d1f19 + 1c29873 commit 769b536
Show file tree
Hide file tree
Showing 1,438 changed files with 129,924 additions and 4,253 deletions.
14 changes: 14 additions & 0 deletions .github/file-filter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,17 @@ tee_test: &tee_test
- 'tee-worker/cli/*.sh'
- 'docker/**'
- 'tee-worker/docker/*.yml'

bitacross_src: &bitacross_src
- 'bitacross-worker/**/*.rs'
- 'bitacross-worker/**/Cargo.toml'
- 'bitacross-worker/**/Cargo.lock'
- 'bitacross-worker/**/rust-toolchain.toml'
- 'bitacross-worker/build.Dockerfile'
- 'bitacross-worker/enclave-runtime/**'

bitacross_test: &bitacross_src
- 'bitacross-worker/ts-tests/**'
- 'bitacross-worker/cli/*.sh'
- 'docker/**'
- 'bitacross-worker/docker/*.yml'
12 changes: 6 additions & 6 deletions .github/workflows/build-docker-with-args.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,24 @@ on:
inputs:
ref:
description: The commit SHA or tag for checking out code
default: ''
default: ""
required: false
cargo_profile:
type: choice
description: which profile to use in cargo
options:
- release
- production
- release
- production
docker_tag:
description: The tag for the built docker image
required: true
args:
description: Args to pass to `cargo build`, e.g. --features=runtime-benchmarks
default: ''
default: ""
required: false

env:
DOCKER_BUILDKIT: 1
DOCKER_BUILDKIT: 1

jobs:
## build docker image of client binary with args ##
Expand Down Expand Up @@ -56,7 +56,7 @@ jobs:
docker cp $(docker create --rm litentry/litentry-parachain:${{ github.event.inputs.docker_tag }}):/usr/local/bin/litentry-collator .
- name: Upload the client binary
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: litentry-collator
path: |
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/build-wasm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ on:
type: choice
description: The chain whose runtime-wasm is built
options:
- litmus
- litentry
- rococo
- litmus
- litentry
- rococo
ref:
description: The commit SHA or tag for checking out code
default: ''
default: ""
required: false

env:
Expand Down Expand Up @@ -50,7 +50,7 @@ jobs:
cp ${{ steps.srtool_build.outputs.wasm_compressed }} ${{ github.event.inputs.chain }}-parachain-runtime.compact.compressed.wasm
- name: Upload wasm artefacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ github.event.inputs.chain }}-parachain-runtime
path: |
Expand Down
120 changes: 100 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,17 +84,19 @@ jobs:
outputs:
rebuild_parachain: ${{ steps.env.outputs.rebuild_parachain }}
rebuild_tee: ${{ steps.env.outputs.rebuild_tee }}
rebuild_bitacross: ${{ steps.env.outputs.rebuild_bitacross }}
push_docker: ${{ steps.env.outputs.push_docker }}
run_parachain_test: ${{ steps.env.outputs.run_parachain_test }}
run_tee_test: ${{ steps.env.outputs.run_tee_test }}
run_bitacross_test: ${{ steps.env.outputs.run_bitacross_test }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

# Checks to see if any files in the PR/commit match one of the listed file types.
# We can use this filter to decide whether or not to build docker images
- uses: dorny/paths-filter@v2
- uses: dorny/paths-filter@v3
id: filter
with:
filters: .github/file-filter.yml
Expand All @@ -105,6 +107,7 @@ jobs:
run: |
rebuild_parachain=false
rebuild_tee=false
rebuild_bitacross=false
push_docker=false
run_parachain_test=false
run_tee_test=false
Expand All @@ -114,6 +117,9 @@ jobs:
if [ "${{ github.event.inputs.rebuild-tee-docker }}" = "true" ] || [ "${{ steps.filter.outputs.tee_src }}" = "true" ]; then
rebuild_tee=true
fi
if [ "${{ github.event.inputs.rebuild-bitacross-docker }}" = "true" ] || [ "${{ steps.filter.outputs.bitacross_src }}" = "true" ]; then
rebuild_bitacross=true
fi
if [ "${{ github.event.inputs.push-docker }}" = "true" ]; then
push_docker=true
elif [ "${{ github.event_name }}" = 'push' ] && [ "${{ github.ref }}" = 'refs/heads/dev' ]; then
Expand All @@ -125,11 +131,16 @@ jobs:
if [ "${{ steps.filter.outputs.tee_test }}" = "true" ] || [ "$rebuild_parachain" = "true" ] || [ "$rebuild_tee" = "true" ]; then
run_tee_test=true
fi
if [ "${{ steps.filter.outputs.bitacross_test }}" = "true" ] || [ "$rebuild_parachain" = "true" ] || [ "$rebuild_bitacross" = "true" ]; then
run_bitacross_test=true
fi
echo "rebuild_parachain=$rebuild_parachain" | tee -a $GITHUB_OUTPUT
echo "rebuild_tee=$rebuild_tee" | tee -a $GITHUB_OUTPUT
echo "rebuild_bitacross=$rebuild_bitacross" | tee -a $GITHUB_OUTPUT
echo "push_docker=$push_docker" | tee -a $GITHUB_OUTPUT
echo "run_parachain_test=$run_parachain_test" | tee -a $GITHUB_OUTPUT
echo "run_tee_test=$run_tee_test" | tee -a $GITHUB_OUTPUT
echo "run_bitacross_test=$$run_tee_test" | tee -a $GITHUB_OUTPUT
fmt:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -159,11 +170,22 @@ jobs:
cargo fmt --all -- --check
taplo fmt --check
- name: Enclave-runtime fmt check
- name: Tee-worker enclave-runtime fmt check
working-directory: ./tee-worker/enclave-runtime
run: |
cargo fmt --all -- --check
- name: bitacross-worker fmt check
working-directory: ./bitacross-worker
run: |
cargo fmt --all -- --check
taplo fmt --check
- name: bitacross-worker enclave-runtime fmt check
working-directory: ./bitacross-worker/enclave-runtime
run: |
cargo fmt --all -- --check
- name: Enable corepack and pnpm
run: corepack enable && corepack enable pnpm

Expand Down Expand Up @@ -282,6 +304,66 @@ jobs:
if: failure()
uses: andymckay/[email protected]

bitacross-clippy:
runs-on: ubuntu-latest
needs:
- fmt
- set-condition
- sequentialise
if: needs.set-condition.outputs.rebuild_bitacross == 'true'
# todo: we might want to change this image in the future
container: "litentry/litentry-tee-dev:latest"
steps:
- uses: actions/checkout@v4

- name: Install dependencies
run: |
sudo apt-get update && \
sudo apt-get install -yq openssl clang libclang-dev cmake protobuf-compiler
- name: bitacross-worker clippy
working-directory: ./bitacross-worker
run: |
echo "::group::cargo clippy all"
cargo clippy --release -- -D warnings
echo "::endgroup::"
echo "::group::cargo clippy sidechain"
cargo clippy --release --features sidechain -- -D warnings
echo "::endgroup::"
echo "::group::cargo clippy offchain-worker"
cargo clean --profile release
cargo clippy --release --features offchain-worker -- -D warnings
echo "::endgroup::"
- name: Clean up disk
working-directory: ./bitacross-worker
run: |
echo "::group::Show disk usage"
df -h .
echo "::endgroup::"
cargo clean --profile release
echo "::group::Show disk usage"
df -h .
echo "::endgroup::"
- name: bitacross-enclave clippy
working-directory: ./bitacross-worker/enclave-runtime
run: |
echo "::group::cargo clippy all"
cargo clippy --release -- -D warnings
echo "::endgroup::"
echo "::group::cargo clippy sidechain"
cargo clippy --release --features sidechain -- -D warnings
echo "::endgroup::"
echo "::group::cargo clippy offchain-worker"
cargo clean --profile release
cargo clippy --release --features offchain-worker -- -D warnings
echo "::endgroup::"
- name: Fail early
if: failure()
uses: andymckay/[email protected]

parachain-build-dev:
runs-on: ubuntu-latest
needs:
Expand Down Expand Up @@ -319,7 +401,7 @@ jobs:
docker save litentry/litentry-parachain:latest | gzip > litentry-parachain-dev.tar.gz
- name: Upload docker image
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: litentry-parachain-dev
path: litentry-parachain-dev.tar.gz
Expand Down Expand Up @@ -356,7 +438,7 @@ jobs:

- name: Cache worker-cache
if: needs.set-condition.outputs.rebuild_tee == 'true'
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
worker-cache
Expand All @@ -378,7 +460,6 @@ jobs:
echo "::group::Show disk usage"
df -h .
echo "::endgroup::"
# cache mount in buildkit won't be exported as image layers, so it doesn't work well with GHA cache, see
# https://github.com/moby/buildkit/issues/1512
# https://www.reddit.com/r/rust/comments/126xeyx/exploring_the_problem_of_faster_cargo_docker/
Expand Down Expand Up @@ -463,12 +544,11 @@ jobs:
run: docker save litentry/litentry-worker:latest litentry/litentry-cli:latest | gzip > litentry-tee.tar.gz

- name: Upload docker images
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: litentry-tee
path: litentry-tee.tar.gz
if-no-files-found: error

- name: Fail early
if: failure()
uses: andymckay/[email protected]
Expand All @@ -487,7 +567,7 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: litentry-parachain-dev

Expand All @@ -513,7 +593,7 @@ jobs:
dest: docker-logs

- name: Upload docker logs if test fails
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: failure()
with:
name: ${{ matrix.chain }}-ts-tests-docker-logs
Expand All @@ -522,7 +602,7 @@ jobs:
retention-days: 3

- name: Archive logs if test fails
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: failure()
with:
name: ${{ matrix.chain }}-ts-tests-artifact
Expand Down Expand Up @@ -625,20 +705,19 @@ jobs:
- test_name: lit-parentchain-nonce
- test_name: lit-ii-batch-test
- test_name: lit-test-stress-script
# disabled due to P-208
# - test_name: lit-resume-worker
- test_name: lit-data-providers-test
steps:
- uses: actions/checkout@v4

- name: Pull polkadot image
run: |
docker pull parity/polkadot
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: litentry-parachain-dev

- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: litentry-tee

Expand Down Expand Up @@ -684,7 +763,7 @@ jobs:
dest: docker-logs

- name: Upload docker logs if test fails
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: failure()
with:
name: ${{ matrix.test_name }}-docker-logs
Expand All @@ -709,18 +788,19 @@ jobs:
- test_name: lit-ii-batch-test-multiworker
- test_name: lit-ii-identity-multiworker-test
- test_name: lit-ii-vc-multiworker-test
- test_name: lit-resume-worker
steps:
- uses: actions/checkout@v4

- name: Pull polkadot image
run: |
docker pull parity/polkadot
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: litentry-parachain-dev

- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: litentry-tee

Expand Down Expand Up @@ -766,7 +846,7 @@ jobs:
dest: docker-logs

- name: Upload docker logs if test fails
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: failure()
with:
name: ${{ matrix.test_name }}-docker-logs
Expand Down Expand Up @@ -796,11 +876,11 @@ jobs:
- tee-single-worker-test
if: ${{ !failure() && needs.set-condition.outputs.push_docker == 'true' }}
steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: litentry-parachain-dev

- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: litentry-tee

Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:

# Checks to see if any files in the PR/commit match one of the listed file types.
# We can use this filter to decide whether or not to build docker images
- uses: dorny/paths-filter@v2
- uses: dorny/paths-filter@v3
id: filter
with:
filters: .github/file-filter.yml
Expand Down Expand Up @@ -63,4 +63,3 @@ jobs:
with:
fail_ci_if_error: false
verbose: true

Loading

0 comments on commit 769b536

Please sign in to comment.