-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
122 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -119,7 +119,7 @@ jobs: | |
if: ${{ !steps.check_permissions.outputs.has-permission }} | ||
run: cargo clippy --profile debug-ci --all-targets -- -D warnings | ||
|
||
test: | ||
build-tests: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
|
@@ -144,6 +144,100 @@ jobs: | |
- name: Cache | ||
uses: Swatinem/rust-cache@v2 | ||
|
||
- name: Install nextest | ||
uses: taiki-e/[email protected] | ||
with: | ||
tool: nextest | ||
|
||
- name: Build and archive tests | ||
run: cargo nextest archive --cargo-profile debug-ci --workspace --all-features --archive-file nextest-archive-${{ matrix.os }}.tar.zst | ||
- name: Upload archive to workflow | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: nextest-archive-${{ matrix.os }} | ||
path: nextest-archive-${{ matrix.os }}.tar.zst | ||
|
||
run-tests: | ||
needs: build-tests | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
# We want newer versions than 'latest' here to have current wasm-opt | ||
os: ["ubuntu-22.04", "macos-12"] | ||
partition: [1, 2] | ||
runs-on: ${{ matrix.os }} | ||
env: | ||
RUST_BACKTRACE: full | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install stable toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
default: true | ||
target: wasm32-unknown-unknown | ||
components: rust-src, clippy | ||
|
||
- name: Cache | ||
uses: Swatinem/rust-cache@v2 | ||
|
||
- name: Install nextest | ||
uses: taiki-e/[email protected] | ||
with: | ||
tool: nextest | ||
|
||
- name: Download archive | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: nextest-archive-${{ matrix.os }} | ||
|
||
- name: Run tests | ||
run: cargo nextest run --archive-file nextest-archive-${{ matrix.os }}.tar.zst --partition count:${{ matrix.partition }}/2 -E 'not (test(integration_tests) | package(contract-build))' | ||
|
||
- name: Run contract build tests | ||
# The contract build tests cannot be run in parallel | ||
run: cargo nextest run --archive-file nextest-archive-${{ matrix.os }}.tar.zst --partition count:${{ matrix.partition }}/2 -j 1 -E 'package(contract-build)' | ||
|
||
run-integration-test: | ||
needs: build-tests | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
# We want newer versions than 'latest' here to have current wasm-opt | ||
os: ["ubuntu-22.04", "macos-12"] | ||
partition: [1, 2] | ||
runs-on: ${{ matrix.os }} | ||
env: | ||
RUST_BACKTRACE: full | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install stable toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
default: true | ||
target: wasm32-unknown-unknown | ||
components: rust-src, clippy | ||
|
||
- name: Cache | ||
uses: Swatinem/rust-cache@v2 | ||
|
||
- name: Install nextest | ||
uses: taiki-e/[email protected] | ||
with: | ||
tool: nextest | ||
|
||
- name: Download archive | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: nextest-archive-${{ matrix.os }} | ||
|
||
- name: Install latest `substrate-contracts-node` binary | ||
env: | ||
CONTRACTS_NODE_URL: https://gitlab.parity.io/parity/mirrors/substrate-contracts-node/-/jobs/artifacts/main/download | ||
|
@@ -162,8 +256,9 @@ jobs: | |
mv artifacts/substrate-contracts-node-$CONTRACTS_NODE_OS/substrate-contracts-node /usr/local/bin | ||
shell: bash | ||
|
||
- name: Run tests | ||
run: cargo test --profile debug-ci --workspace --all-features -- --test-threads=1 | ||
- name: Run integration tests | ||
# The integration tests cannot be run in parallel | ||
run: cargo nextest run --archive-file nextest-archive-${{ matrix.os }}.tar.zst --partition count:${{ matrix.partition }}/2 -j 1 -E 'test(integration_tests)' | ||
|
||
template: | ||
strategy: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters