chore: add tests for Peregrine #36
Workflow file for this run
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
name: Lint and Test | |
on: | |
push: | |
branches: | |
- "main" | |
paths: | |
- "**.ts" | |
pull_request: | |
branches: | |
- "*" | |
jobs: | |
build-polkadot-binary: | |
name: Build Polkadot binary | |
runs-on: ubuntu-latest | |
timeout-minutes: 500 | |
steps: | |
- name: Download polkadot repo | |
uses: actions/checkout@v4 | |
with: | |
# TODO: Change to polkadot-sdk after v1.0.0 | |
repository: paritytech/polkadot | |
# TODO: Change to something else or make it a parameter | |
ref: v1.0.0 | |
- name: Install required libraries | |
uses: arduino/setup-protoc@v2 | |
- name: Install required targets | |
run: rustup target install wasm32-unknown-unknown | |
- name: Show rustup info | |
run: rustup show | |
- name: Set up cargo cache | |
uses: Swatinem/rust-cache@v2 | |
- name: Build binary | |
uses: actions-rs/cargo@v1 | |
with: | |
command: build | |
args: --release --locked -p polkadot | |
- name: Configure cache for built binaries | |
uses: actions/cache@v3 | |
with: | |
path: binaries | |
# TODO: Parametrize over value of `ref` in step 1. | |
key: binaries-polkadot-v1.0.0 | |
- name: Copy binaries to cache | |
run: | | |
cp target/release/polkadot binaries/polkadot | |
build-dip-binaries: | |
name: Build DIP template and kilt-parachain binaries | |
runs-on: ubuntu-latest | |
timeout-minutes: 500 | |
steps: | |
- name: Download kilt-node repo | |
uses: actions/checkout@v4 | |
with: | |
repository: KILTprotocol/kilt-node | |
# TODO: Change to something else or make it a parameter | |
ref: develop | |
- name: Install required libraries | |
uses: arduino/setup-protoc@v2 | |
- name: Install required targets | |
run: rustup target install wasm32-unknown-unknown | |
- name: Show rustup info | |
run: rustup show | |
- name: Set up cargo cache | |
uses: Swatinem/rust-cache@v2 | |
- name: Build binaries | |
uses: actions-rs/cargo@v1 | |
with: | |
command: build | |
# TODO: Add kilt-parachain | |
args: --release --locked -p dip-provider-node-template -p dip-consumer-node-template | |
- name: Configure cache for built binaries | |
uses: actions/cache@v3 | |
with: | |
path: binaries | |
# TODO: Parametrize over value of `ref` in step 1. | |
key: binaries-dip-aa/dip | |
- name: Copy binaries to cache | |
run: | | |
cp target/release/dip-provider-node-template binaries/dip-provider-node-template | |
cp target/release/dip-consumer-node-template binaries/dip-consumer-node-template | |
lint-and-test: | |
name: Spin up Zombienet network and run integration tests | |
needs: | |
- build-polkadot-binary | |
- build-dip-binaries | |
runs-on: ubuntu-latest | |
timeout-minutes: 500 | |
steps: | |
- name: Download source | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version-file: ".nvmrc" | |
cache: "yarn" | |
- name: Install dependencies | |
run: yarn install --immutable | |
- name: Lint | |
run: yarn lint | |
- name: Check dependency duplication | |
run: if ! yarn dedupe --check; then echo "::warning ::Dependencies may be deduplicated"; fi; | |
- name: Check versioning | |
run: yarn version check | |
- name: Set environment variables | |
run: cat ./tests/.env.test >> $GITHUB_ENV | |
- name: Retrieve cache for polkadot binary | |
uses: actions/cache@v3 | |
with: | |
path: binaries | |
key: binaries-polkadot-v1.0.0 | |
- name: Retrieve cache for DIP binaries | |
uses: actions/cache@v3 | |
with: | |
path: binaries | |
key: binaries-dip-aa/dip | |
- name: Spin up network (in the background) | |
run: yarn test:e2e:start-network:native |