-
Notifications
You must be signed in to change notification settings - Fork 1
103 lines (85 loc) · 2.73 KB
/
test.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
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: Manic Minter Test
on:
pull_request:
branches:
- main
push:
branches:
- main
env:
SWANKY_NODE_VER: v1.2.0
CONTRACTS_NODE: ./swanky-node
NIGHTLY_VER: nightly-2023-01-10
CARGO_CONTRACT_VER: 2.1.0
jobs:
install:
runs-on: ubuntu-latest
steps:
- name: Checkout the source code
uses: actions/checkout@v3
- name: Install & display rust toolchain
run: |
rustup show
rustup toolchain install ${{ env.NIGHTLY_VER }}
rustup component add rust-src --toolchain ${{ env.NIGHTLY_VER }}-x86_64-unknown-linux-gnu
rustup component add clippy --toolchain ${{ env.NIGHTLY_VER }}-x86_64-unknown-linux-gnu
rustup show
- name: Check targets are installed correctly
run: rustup target list --installed
- name: Cargo check
run: cargo check
- name: Check Clippy
run: cargo clippy
format:
needs: install
runs-on: ubuntu-latest
steps:
- name: Use cashed cargo
uses: actions/cache@v3
with:
path: ~/.cargo
key: ${{ runner.os }}-rust-${{ hashFiles('rust-toolchain.toml') }}
- name: Checkout the source code
uses: actions/checkout@v3
- name: Format rust code
run: cargo fmt --all
unittest:
needs: install
runs-on: ubuntu-latest
steps:
- name: Use cashed cargo
uses: actions/cache@v3
with:
path: ~/.cargo
key: ${{ runner.os }}-rust-${{ hashFiles('rust-toolchain.toml') }}
- name: Checkout the source code
uses: actions/checkout@v3
- name: Format rust code
run: cargo test
# integration:
# needs: install
# runs-on: ubuntu-latest
# steps:
# - name: Use cashed cargo
# uses: actions/cache@v3
# with:
# path: ~/.cargo
# key: ${{ runner.os }}-rust-${{ hashFiles('rust-toolchain.toml') }}
# - name: Checkout the source code
# uses: actions/checkout@v3
# - name: Check what's installed
# run: |
# rustup show
# rustup target list --installed
# - name: Install cargo contract
# run: |
# cargo install cargo-dylint dylint-link
# cargo install cargo-contract --force --version ${{ env.CARGO_CONTRACT_VER }}
# - name: download Swanky-node
# run: |
# sudo wget https://github.com/AstarNetwork/swanky-node/releases/download/${{ env.SWANKY_NODE_VER }}/swanky-node-${{ env.SWANKY_NODE_VER }}-ubuntu-x86_64.tar.gz
# sudo tar -zxvf swanky-node-${{ env.SWANKY_NODE_VER }}-ubuntu-x86_64.tar.gz
# sudo chmod +x swanky-node
# ls -la
# - name: e2e test
# run: cargo test --features e2e-tests