CI tests #71
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: 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: Setup Era test node | |
run: make setup | |
- name: Copy our precompiles to era-test-node system contracts | |
run: cp -r precompiles/ submodules/era-test-node/etc/system-contracts/contracts/precompiles | |
- name: Build precompiles | |
working-directory: submodules/era-test-node | |
run: make build-precompiles | |
- name: Start era-test-node (Persistent) | |
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: Print 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() | |
run: cat era-test-node.log |