-
Notifications
You must be signed in to change notification settings - Fork 19
87 lines (70 loc) · 2.33 KB
/
ci.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
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