-
Notifications
You must be signed in to change notification settings - Fork 22
86 lines (73 loc) · 2.26 KB
/
cargo-tests.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
name: "cargo tests"
on:
push:
branches:
- main
- plain-cumulus-template
paths-ignore:
- "**.md"
- "**.adoc"
pull_request:
paths-ignore:
- "**.md"
- "**.adoc"
workflow_dispatch:
inputs:
test-macos:
description: "run tests on macOS"
required: true
default: false
type: boolean
env:
# Not needed in CI, should make things a bit faster
CARGO_INCREMENTAL: 0
CARGO_TERM_COLOR: always
# Remove unnecessary WASM build artifacts
WASM_BUILD_CLEAN_TARGET: 1
jobs:
clippy-fmt-test:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-22.04
- macos-12
run-all:
- ${{ inputs.test-macos == true || github.ref == 'refs/heads/main' }}
exclude: # exclude macos-12 when the condition is false
- run-all: false
os: macos-12
runs-on: ${{ matrix.os }}
steps:
- name: git checkout
uses: actions/checkout@v4
- name: Install Protoc
uses: arduino/setup-protoc@9b1ee5b22b0a3f1feb8c2ff99b32c89b3c3191e9 # v2.0.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: install rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Install toml-sort
run: cargo install --git https://github.com/4meta5/toml_sort
- name: Add file permissions for toml-sort
run: chmod +x ./scripts/toml-sort.sh
- name: Add file permissions for check-toml-sorted
run: chmod +x ./scripts/check-toml-sorted.sh
- name: Check Cargo.toml files are formatted using toml_sort
run: ./scripts/check-toml-sorted.sh
- name: Check format
run: cargo fmt --all -- --check
- name: Run tests
run: cargo test
- name: Check build
run: cargo check --release
- name: Check clippy
run: cargo clippy --locked --all-targets -- -D warnings
- name: Check Documentation
run: cargo doc --locked --all --no-deps
env:
RUSTDOCFLAGS: "-D rustdoc::broken-intra-doc-links -D rustdoc::private_intra_doc_links"
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}