-
Notifications
You must be signed in to change notification settings - Fork 27
101 lines (78 loc) · 2.33 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
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
name: Continuous Integration
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
GITHUB_ACTOR: pop-cli
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check formatting
run: cargo fmt --all -- --check
build:
needs: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: "./.github/actions/init"
with:
git-user: ${{ env.GITHUB_ACTOR }}
- name: Check Feature Contracts Excl.
run: cargo check --no-default-features --features contract
- name: Check Features Parachain Excl.
run: cargo check --no-default-features --features parachain
- name: Build default features
run: cargo build
unit-tests:
needs: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: "./.github/actions/init"
with:
git-user: ${{ env.GITHUB_ACTOR }}
- name: Run unit tests
run: cargo test --lib --bins
coverage:
needs: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: "./.github/actions/init"
with:
git-user: ${{ env.GITHUB_ACTOR }}
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Generate code coverage
run: cargo llvm-cov --all-features --workspace --lib --bins --codecov --output-path codecov.json
- name: Upload to codecov.io
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: codecov.json
fail_ci_if_error: true
contract-integration-tests:
needs: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: "./.github/actions/init"
with:
git-user: ${{ env.GITHUB_ACTOR }}
- name: Run integration tests
run: cargo test --no-default-features --features contract --test contract
parachain-integration-tests:
needs: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: "./.github/actions/init"
with:
git-user: ${{ env.GITHUB_ACTOR }}
- name: Run integration tests
run: cargo test --no-default-features --features parachain --test parachain