-
Notifications
You must be signed in to change notification settings - Fork 2
66 lines (51 loc) · 1.37 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
name: Rust CI
on:
push:
branches:
- main
- sepolia-db
pull_request:
branches:
- main
- sepolia-db
jobs:
fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup toolchain
run: rustup toolchain install stable
- name: Install dependencies
run: cargo fetch
- name: Install coverage tool
run: cargo install cargo-tarpaulin
- uses: Swatinem/rust-cache@v2
- name: Check code formatting
run: cargo fmt -- --check
clippy:
needs: [fmt]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v2
- name: Run Clippy
run: cargo clippy --all-targets --all-features -- -D warnings
tests:
needs: [fmt, clippy]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v2
- name: Setup test env
uses: hoverkraft-tech/[email protected]
with:
compose-file: "./docker-compose.test.yml"
- run: chmod +x scripts/run-coverage.sh
- name: Run tests
run: scripts/run-coverage.sh
- name: Report code coverage
uses: zgosalvez/github-actions-report-lcov@v3
with:
coverage-files: lcov.info
github-token: ${{ secrets.GITHUB_TOKEN }}
update-comment: true