-
Notifications
You must be signed in to change notification settings - Fork 0
92 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
name: CI tests
on:
push:
branches:
- master
pull_request:
branches:
- master
env:
CARGO_TERM_COLOR: always
CARGO_NET_GIT_FETCH_WITH_CLI: true
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true
jobs:
linting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- uses: webfactory/[email protected]
with:
ssh-private-key: |
${{ secrets.MAMORU_CORE_KEY }}
${{ secrets.VALIDATION_CHAIN_KEY }}
- uses: ./.github/actions/install-deps
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: Swatinem/rust-cache@v2
- name: Run linting
run: |
cargo fmt -- --check
cargo clippy --workspace --tests -- -D warnings -A clippy::non_canonical_clone_impl -A clippy::redundant_closure_call -A clippy::transmute-int-to-bool
build:
runs-on: self-hosted
steps:
- uses: actions/checkout@v3
- uses: webfactory/[email protected]
with:
ssh-private-key: |
${{ secrets.MAMORU_CORE_KEY }}
${{ secrets.VALIDATION_CHAIN_KEY }}
- uses: ./.github/actions/install-deps
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Build
run: cargo build -r --verbose
tests:
runs-on: self-hosted
steps:
- uses: actions/checkout@v3
- uses: webfactory/[email protected]
with:
ssh-private-key: |
${{ secrets.MAMORU_CORE_KEY }}
${{ secrets.VALIDATION_CHAIN_KEY }}
- uses: ./.github/actions/install-deps
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Run tests
run: make test
test-coverage:
runs-on: self-hosted
steps:
- uses: actions/checkout@v3
- uses: webfactory/[email protected]
with:
ssh-private-key: |
${{ secrets.MAMORU_CORE_KEY }}
${{ secrets.VALIDATION_CHAIN_KEY }}
- uses: ./.github/actions/install-deps
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install cargo-llvm-cov
run: rustup update && cargo clean && cargo install cargo-llvm-cov --quiet
- name: Generate code coverage
run: cargo llvm-cov