-
Notifications
You must be signed in to change notification settings - Fork 6
59 lines (46 loc) · 1.53 KB
/
rust.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
name: Rust
on:
push:
branches:
- main
tags:
- "**"
pull_request:
branches:
- "**"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Cargo binstall
run: curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
- name: Instal cargo-workspaces
run: cargo binstall cargo-workspaces --locked -y
- name: Install cargo-tarpaulin
run: cargo binstall cargo-tarpaulin --locked -y
- name: Run tests
run: cargo tarpaulin --release --workspace --exclude chia-wallet-sdk-napi --all-features --out xml
- name: Upload coverage reports to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Cleanup coverage reports
run: rm -f cobertura.xml
- name: Clippy
run: cargo clippy --workspace --all-features --all-targets
- name: Unused dependencies
run: |
cargo binstall cargo-machete --locked -y
cargo machete
- name: Fmt
run: cargo fmt --all -- --files-with-diff --check
- name: Publish
if: startsWith(github.event.ref, 'refs/tags')
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.cargo_registry_token }}
run: cargo ws publish --publish-as-is --allow-dirty