forked from Supercolony-net/obce
-
Notifications
You must be signed in to change notification settings - Fork 8
53 lines (51 loc) · 1.81 KB
/
ci.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
name: CI/CD
on:
pull_request:
branches: [ main ]
jobs:
unit-tests:
name: Run unit tests
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Nix
uses: cachix/install-nix-action@v18
- name: Rustfmt check
run: nix develop -c cargo fmt --all --check
- name: Run tests with substrate-std
run: RUSTFLAGS="-D warnings" nix develop -c cargo test --workspace --features substrate-std
- name: Run tests with ink-std
run: RUSTFLAGS="-D warnings" nix develop -c cargo test --workspace --features ink-std
integration-tests:
name: Run integration tests
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Nix
uses: cachix/install-nix-action@v18
- name: Download OBCE test environment
run: git clone https://github.com/727-Ventures/obce-test-environment
- name: Bootstrap OBCE test environment
working-directory: ./obce-test-environment
run: |
rm -rf .git
nix develop -c cargo build
./target/debug/substrate-contracts-node --tmp --dev &
- name: Install cargo-contract
run: nix develop -c cargo install cargo-contract --git https://github.com/paritytech/cargo-contract
- name: Run yarn
run: nix develop -c yarn
- name: Build test contract
working-directory: ./tests/e2e/contract
run: nix develop -c cargo contract build
- name: Copy artifacts
run: |
mkdir artifacts
cp ./tests/e2e/contract/target/ink/contract.contract artifacts/
cp ./tests/e2e/contract/target/ink/contract.json artifacts/
- name: Run Typechain compiler
run: nix develop -c yarn build:release:no-compile
- name: Run tests
run: nix develop -c yarn test:mocha