Skip to content

Commit

Permalink
Improve workflow (#1539)
Browse files Browse the repository at this point in the history
* improve workflow

* run benchmarking separately

* increase the timeout
  • Loading branch information
zjb0807 authored Oct 27, 2021
1 parent 4541887 commit 1c17769
Show file tree
Hide file tree
Showing 3 changed files with 192 additions and 44 deletions.
140 changes: 97 additions & 43 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# generate by yq eval 'explode(.)' test.yml.src > test.yml
# https://github.com/mikefarah/yq
name: Test

on:
pull_request:
branches:
Expand All @@ -13,7 +14,6 @@ on:
- release-**
paths-ignore:
- '**/README.md'

jobs:
clean-up-actions:
runs-on: ubuntu-latest
Expand All @@ -24,51 +24,105 @@ jobs:
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
build:
runs-on: [self-hosted, linux]
env:
SCCACHE_CACHE_SIZE: "50G"
CARGO_INCREMENTAL: 0
needs: clean-up-actions
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly-2021-06-17
components: rustfmt
target: wasm32-unknown-unknown
default: true
- name: Check format
run: cargo fmt --all -- --check
- name: Build
run: make build-all
- name: Install clippy
run: rustup component add clippy
- name: Run mandala-runtime clippy
run: cargo clippy --features with-mandala-runtime -- -D warnings
- name: Run karura-runtime clippy
run: cargo clippy --features with-karura-runtime -- -D warnings
- name: Run acala-runtime clippy
run: cargo clippy --features with-acala-runtime -- -D warnings
benchmarking:
runs-on: [self-hosted, linux]
env:
SCCACHE_CACHE_SIZE: "50G"
CARGO_INCREMENTAL: 0
needs: clean-up-actions
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly-2021-06-17
components: rustfmt
target: wasm32-unknown-unknown
default: true
- name: Run benchmarking tests
run: make test-benchmarking
checks-and-tests:
runs-on: [self-hosted, linux]
env:
SCCACHE_CACHE_SIZE: "50G"
CARGO_INCREMENTAL: 0
needs: clean-up-actions
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly-2021-06-17
components: rustfmt
target: wasm32-unknown-unknown
default: true
- name: Check format
run: cargo fmt --all -- --check
- name: Build
run: make build-all
- name: Install clippy
run: rustup component add clippy
- name: Run mandala-runtime clippy
run: cargo clippy --features with-mandala-runtime -- -D warnings
- name: Run karura-runtime clippy
run: cargo clippy --features with-karura-runtime -- -D warnings
- name: Run acala-runtime clippy
run: cargo clippy --features with-acala-runtime -- -D warnings
- name: Run runtime tests
run: make test-runtimes
- name: Run eth tests
run: make test-eth
- name: Run benchmarking tests
run: make test-benchmarking
- name: Check benchmarks
run: make check-benchmarks
- name: Check try-runtime
run: make check-try-runtime
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: 14.x
- name: Run ts tests
run: |
npm install -g yarn
make test-ts
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly-2021-06-17
components: rustfmt
target: wasm32-unknown-unknown
default: true
- name: Run runtime tests
run: make test-runtimes
- name: Run eth tests
run: make test-eth
- name: Check benchmarks
run: make check-benchmarks
- name: Check try-runtime
run: make check-try-runtime
e2e-tests:
runs-on: [self-hosted, linux]
env:
SCCACHE_CACHE_SIZE: "50G"
CARGO_INCREMENTAL: 0
needs: clean-up-actions
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly-2021-06-17
components: rustfmt
target: wasm32-unknown-unknown
default: true
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: 14.x
- name: Run ts tests
run: |
npm install -g yarn
make test-ts
94 changes: 94 additions & 0 deletions .github/workflows/test.yml.src
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# generate by yq eval 'explode(.)' test.yml.src > test.yml
# https://github.com/mikefarah/yq

name: Test
on:
pull_request:
branches:
- master
- release-**
paths-ignore:
- '**/README.md'
push:
branches:
- master
- release-**
paths-ignore:
- '**/README.md'
jobs:
clean-up-actions:
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
# Only cancel non-master branch runs
if: ${{ github.ref != 'refs/heads/master' }}
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
build: &setup
runs-on:
[self-hosted, linux]
env:
SCCACHE_CACHE_SIZE: "50G"
CARGO_INCREMENTAL: 0
needs: clean-up-actions
steps:
- &checkout
uses: actions/checkout@v2
with:
submodules: recursive
- &toolchain
name: Install toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly-2021-06-17
components: rustfmt
target: wasm32-unknown-unknown
default: true
- name: Check format
run: cargo fmt --all -- --check
- name: Build
run: make build-all
- name: Install clippy
run: rustup component add clippy
- name: Run mandala-runtime clippy
run: cargo clippy --features with-mandala-runtime -- -D warnings
- name: Run karura-runtime clippy
run: cargo clippy --features with-karura-runtime -- -D warnings
- name: Run acala-runtime clippy
run: cargo clippy --features with-acala-runtime -- -D warnings
benchmarking:
<<: *setup
steps:
- *checkout
- *toolchain
- name: Run benchmarking tests
run: make test-benchmarking
checks-and-tests:
<<: *setup
steps:
- *checkout
- *toolchain
- name: Run runtime tests
run: make test-runtimes
- name: Run eth tests
run: make test-eth

- name: Check benchmarks
run: make check-benchmarks
- name: Check try-runtime
run: make check-try-runtime
e2e-tests:
<<: *setup
steps:
- *checkout
- *toolchain
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: 14.x
- name: Run ts tests
run: |
npm install -g yarn
make test-ts
2 changes: 1 addition & 1 deletion ts-tests/tests/test-nonce.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import Erc20DemoContract from "../build/Erc20DemoContract.json"

describeWithAcala("Acala RPC (Nonce)", (context) => {
step("get nonce", async function () {
this.timeout(10_000);
this.timeout(20000);
const [alice, alice_stash] = await context.provider.getWallets();

expect(await context.provider.getTransactionCount(await alice.getAddress(), 'earliest')).to.eq(0);
Expand Down

0 comments on commit 1c17769

Please sign in to comment.