Skip to content
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
2 changes: 1 addition & 1 deletion .github/workflows/benchmark-machine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
echo "Remote instance reachable now after $SECONDS seconds"
remote_ip=`aws ec2 describe-instances --filters 'Name=instance-state-name,Values=running' 'Name=instance-id,Values=${{ env.INSTANCE_ID }}' --query 'Reservations[*].Instances[*].[PublicIpAddress]' --output text`
echo "Running instances ip address: $remote_ip"
echo "::set-output name=remote_ip::$remote_ip"
echo "remote_ip=$remote_ip" >> $GITHUB_OUTPUT

# exit status should propagate through ssh
- name: Remotely benchmark machine
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/benchmark-runtime-weights.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ env:
INSTANCE_ID: ${{ secrets.BENCHMARK_INSTANCE_ID }} # remote AWS host to run benchmarking
BENCHMARK_SSH_USER: ${{ secrets.BENCHMARK_SSH_USER }}
BENCHMARK_SSH_KEYPATH: ${{ secrets.BENCHMARK_SSH_KEYPATH }}
DOCKER_BUILDKIT: 1

jobs:
## build docker image with runtime-benchmarks feature
build-docker:
Expand Down Expand Up @@ -112,7 +114,7 @@ jobs:
echo "Remote instance reachable now after $SECONDS seconds"
remote_ip=`aws ec2 describe-instances --filters 'Name=instance-state-name,Values=running' 'Name=instance-id,Values=${{ env.INSTANCE_ID }}' --query 'Reservations[*].Instances[*].[PublicIpAddress]' --output text`
echo "Running instances ip address: $remote_ip"
echo "::set-output name=remote_ip::$remote_ip"
echo "remote_ip=$remote_ip" >> $GITHUB_OUTPUT

# exit status should propagate through ssh
- name: Remotely benchmark pallets ${{ github.event.inputs.pallets }} for ${{ env.CHAIN }}
Expand Down
44 changes: 30 additions & 14 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ on:

env:
CARGO_TERM_COLOR: always
DOCKER_BUILDKIT: 1
# the branch or tag on which this workflow is triggered
# `head_ref` will only be set if the triggering event is `pull_request`
REF_VERSION: ${{ github.head_ref || github.ref_name }}

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -73,8 +77,14 @@ jobs:
- name: Run cargo fmt check
run: make fmtcheck

- name: Install taplo
run: cargo install taplo-cli --locked
- name: Install pre-built taplo
run: |
mkdir -p $HOME/.local/bin
wget -q https://github.com/tamasfe/taplo/releases/latest/download/taplo-linux-x86_64.gz
gzip -d taplo-linux-x86_64.gz
cp taplo-linux-x86_64 $HOME/.local/bin/taplo
chmod a+x $HOME/.local/bin/taplo
echo "$HOME/.local/bin" >> $GITHUB_PATH

- name: Run taplo fmt check
run: make taplocheck
Expand Down Expand Up @@ -145,6 +155,10 @@ jobs:
run: |
[ -z "$(docker images --filter=dangling=true -q)" ] || docker rmi -f $(docker images --filter=dangling=true -q)

- name: Fail-fast; cancel other jobs
if: failure()
uses: andymckay/[email protected]

run-ts-tests:
runs-on: ubuntu-latest
needs: build-docker
Expand Down Expand Up @@ -204,7 +218,7 @@ jobs:
default: true

- name: Run unittests
run: cargo test --release -p pallet-* --lib
run: cargo test --locked --release -p pallet-* --lib

- name: Fail-fast; cancel other jobs
if: failure()
Expand All @@ -228,7 +242,7 @@ jobs:
default: true

- name: Run benchmarks
run: cargo test --release -p pallet-* --lib --features runtime-benchmarks
run: cargo test --locked --release -p pallet-* --lib --features runtime-benchmarks

- name: Fail-fast; cancel other jobs
if: failure()
Expand All @@ -241,16 +255,17 @@ jobs:
# This is required when setting github merge rules to protected branch,
# where you can only select one of `run-cargo-runtime-tests` and `run-cargo-runtime-tests(litmus)`.
# If you put if-check on the job level, it can't fit every possible case.
#
# Tried https://github.com/Swatinem/rust-cache too but it didn't work so well
run-cargo-runtime-tests:
runs-on: ubuntu-latest
needs: [check-cargo-fmt, check-file-change]
env:
RUST_BACKTRACE: full
RUSTC_WRAPPER: sccache
SCCACHE_CACHE_SIZE: 10G
SCCACHE_DIR: /home/runner/.cache/sccache
CARGO_INCREMENTAL: 0
strategy:
fail-fast: true
matrix:
chain:
- litmus
Expand All @@ -273,10 +288,9 @@ jobs:
# use sccache to accelerate binary compilation
# see https://www.infinyon.com/blog/2021/04/github-actions-best-practices/
- name: Install sccache
if: needs.check-file-change.outputs.src == 'true'
env:
LINK: https://github.com/mozilla/sccache/releases/download
SCCACHE_VERSION: v0.2.15
SCCACHE_VERSION: v0.3.0
run: |
SCCACHE_FILE=sccache-$SCCACHE_VERSION-x86_64-unknown-linux-musl
mkdir -p $HOME/.local/bin
Expand All @@ -287,29 +301,31 @@ jobs:

- name: Cache cargo registry
if: needs.check-file-change.outputs.src == 'true'
uses: actions/cache@v2
uses: actions/cache@v3
continue-on-error: false
with:
path: |
~/.cargo/registry
~/.cargo/git
key: cargo-${{ hashFiles('**/Cargo.lock') }}
key: cargo-${{ env.REF_VERSION }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
cargo-${{ env.REF_VERSION }}-
cargo-

- name: Cache sccache
if: needs.check-file-change.outputs.src == 'true'
uses: actions/cache@v2
uses: actions/cache@v3
continue-on-error: false
with:
path: /home/runner/.cache/sccache
key: sccache-${{ hashFiles('**/Cargo.lock') }}
key: sccache-${{ env.REF_VERSION }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
sccache-${{ env.REF_VERSION }}-
sccache-

- name: Run runtime integration tests
if: needs.check-file-change.outputs.src == 'true'
run: cargo test --release -p ${{ matrix.chain }}-parachain-runtime --lib
run: cargo test --locked --release -p ${{ matrix.chain }}-parachain-runtime --lib

- name: Print sccache stats
if: needs.check-file-change.outputs.src == 'true'
Expand Down Expand Up @@ -343,7 +359,7 @@ jobs:
docker load -i litentry-parachain.tar

- name: Dockerhub login
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/build-docker-with-args.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ on:
default: ''
required: false

env:
DOCKER_BUILDKIT: 1

jobs:
## build docker image of client binary with args ##
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/create-release-draft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ env:
RELEASE_TAG: ${{ github.event.inputs.release_tag }}
DIFF_TAG: ${{ github.event.inputs.diff_tag }}
GENESIS_RELEASE: ${{ github.event.inputs.genesis_release }}
DOCKER_BUILDKIT: 1

jobs:
set-release-type:
Expand All @@ -52,7 +53,7 @@ jobs:
echo "::error::Please select at least one release type."
exit 1
fi
echo "::set-output name=release_type::${release_type}"
echo "release_type=${release_type}" >> $GITHUB_OUTPUT
outputs:
release_type: ${{ steps.vars.outputs.release_type }}

Expand Down
Loading