This repository has been archived by the owner on Nov 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
91 lines (76 loc) · 2.11 KB
/
test.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
# Testing CI - Runs on each PR and Push
name: Test
on:
pull_request:
push:
branches:
- main
permissions:
id-token: write
contents: read
env:
CARGO_TERM_COLOR: always
RUST_TOOLCHAIN: nightly-2024-01-11
RUST_COMPONENTS: "rust-std"
jobs:
# cargo fmt check
check-formatting:
runs-on: ubuntu-latest
steps:
- uses: RDXWorks-actions/checkout@main
- name: Install Rust Toolchain
uses: RDXWorks-actions/toolchain@master
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}
default: true
components: rustfmt
- name: Check formatting
run: cargo fmt --check
# clippy
check-clippy:
runs-on: ubuntu-latest
steps:
- uses: RDXWorks-actions/checkout@main
- name: Install Rust Toolchain
uses: RDXWorks-actions/toolchain@master
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}
default: true
components: clippy
- name: Clippy Check
run: cargo clippy --all
# Rust unit, doc and integration
test-rust:
runs-on: ubuntu-latest
steps:
- uses: RDXWorks-actions/checkout@main
- name: Install Rust Toolchain
uses: RDXWorks-actions/toolchain@master
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}
default: true
- name: Run rust tests
run: cargo test
# Code Coverage uses Tarpaulin and uploads to CodeCov.io
code-coverage:
runs-on: ubuntu-latest
steps:
- uses: RDXWorks-actions/checkout@main
- name: Install Rust Toolchain
uses: RDXWorks-actions/toolchain@master
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}
default: true
- name: Install cargo tarpaulin
uses: RDXWorks-actions/cargo-install@main
with:
crate: cargo-tarpaulin
tag: 0.30.0
locked: true
- name: Code Coverage - Generate
run: cargo tarpaulin --out xml
- name: Code Coverage - Upload to CodeCov.io
uses: RDXWorks-actions/codecov-action@main
with:
token: ${{ secrets.CODECOV }}
fail_ci_if_error: true