Skip to content

CI tests

CI tests #74

Workflow file for this run

name: CI
on:
merge_group:
push:
branches: [main]
pull_request:
branches: ["*"]
concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
compile:
name: Compile
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Rustup toolchain install
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
targets: wasm32-unknown-unknown
- name: Run cargo check
run: cd tests && cargo check
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
components: rustfmt, clippy
- name: Run cargo fmt
run: cd tests && cargo fmt --all -- --check
- name: Run clippy
run: cd tests && cargo clippy --all-targets --all-features -- -D warnings
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- name: "era-test-node: setup"
run: make setup
- name: "era-test-node: Copy our precompiles to the system-contracts"
run: cp -r precompiles/ submodules/era-test-node/etc/system-contracts/contracts/precompiles
- name: "era-test-node: build precompiles"
working-directory: submodules/era-test-node
run: make build-precompiles
- name: "era-test-node: start"
working-directory: submodules/era-test-node
# The usage of `nohup ... &` guarantees that the server will keep on
# running after
run: nohup cargo run -- --show-calls=all --resolve-hashes run > era-test-node.log 2>&1 &
- name: Run tests # FIXME run the tests for real
run: sleep 1m && false # Simulate a failure
# Make the Era logs available us.
- name: "era-test-node: logs"
# Yes, I'm aware that using `always()` will execute this step regardless of
# whether the job was canceled. However, this is not an issue since it's
# just a `cat` command.
if: always()
working-directory: submodules/era-test-node
run: cat era-test-node.log