-
Notifications
You must be signed in to change notification settings - Fork 37
88 lines (72 loc) · 2.3 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
# Based on https://github.com/actions-rs/example/blob/master/.github/workflows/quickstart.yml
on: [push, pull_request]
name: Tests
jobs:
unit-test:
name: Unit Tests
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
- name: Run Unit Tests
run: cargo unit-test
integration-tests:
name: Integration Tests
runs-on: ubuntu-latest
services:
# Label used to access the service container
secretdev:
# Docker Hub image
options: --name secretdev
image: ghcr.io/scrtlabs/localsecret:v1.6.0-alpha.4
volumes:
- "/home/runner/work/snip20-reference-impl/snip20-reference-impl/:/root/code"
ports:
# Opens tcp port
- 5000:5000
- 9091:9091
- 1317:1317
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
- name: Compile WASM contract
run: |
sudo apt-get install -y binaryen
make compile-optimized && make compile-optimized-receiver
# - name: Compile WASM contract
# uses: actions-rs/cargo@v1
# with:
# command: build
# args: --release --target wasm32-unknown-unknown --locked
# env:
# RUSTFLAGS: "-C link-arg=-s"
- name: Run Integration Tests
run: |
./tests/integration.sh
lints:
name: Lints
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Run cargo fmt
run: cargo fmt --all -- --check
- name: Run cargo clippy
run: cargo clippy -- -D warnings
# TODO: we should check
# CHANGES_IN_REPO=$(git status --porcelain)
# after this, but I don't know how
- name: Generate Schema
run: cargo schema --locked