-
Notifications
You must be signed in to change notification settings - Fork 1
61 lines (51 loc) · 1.6 KB
/
general-rust.yml
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
name: General Rust
on:
push:
branches:
- "main"
pull_request:
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
jobs:
format:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run cargo fmt
run: make fmt-rust-check
test-prepare:
name: Prepare tests
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.create-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v3
- name: Create test matrix
id: create-matrix
run: |
echo "matrix=$(python3 scripts/create-test-matrix.py)" >> $GITHUB_OUTPUT
test:
name: Test
runs-on: ubuntu-latest
needs: test-prepare
strategy:
matrix:
test: ${{ fromJson(needs.test-prepare.outputs.matrix) }}
steps:
- uses: actions/checkout@v3
- name: Install Rust dependencies
run: |
rustup component add rust-src
- name: Download substrate-contracts-node
run: |
wget https://github.com/paritytech/substrate-contracts-node/releases/latest/download/substrate-contracts-node-linux.tar.gz -P $HOME/substrate-contracts-node
tar -xvf $HOME/substrate-contracts-node/substrate-contracts-node-linux.tar.gz -C $HOME/substrate-contracts-node
mkdir -p $HOME/.local/bin
cp $HOME/substrate-contracts-node/artifacts/substrate-contracts-node-linux/substrate-contracts-node $HOME/.local/bin
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Run test
run: |
cd test-cases/${{ matrix.test }}
cargo test --all --all-features