-
Notifications
You must be signed in to change notification settings - Fork 242
116 lines (111 loc) · 3.07 KB
/
test.yml
File metadata and controls
116 lines (111 loc) · 3.07 KB
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
name: Build & Test
on:
workflow_dispatch:
workflow_call:
inputs:
plan:
required: false
type: string
# pull_request: # No need to trigger on PR, cargo-dist already does
push:
branches:
- master
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
nextest:
runs-on: ${{matrix.os}}
strategy:
matrix:
build: [linux, macos]
include:
- build: linux
os: ubuntu-latest
target: x86_64-unknown-linux-musl
- build: macos
os: macos-latest
target: x86_64-apple-darwin
steps:
- name: "[linux] Install dependencies"
run: |
sudo apt-get install tmux
tmux -V
locale
if: runner.os == 'Linux'
- name: "[macos] Install dependencies"
run: |
brew install tmux
tmux -V
locale
if: runner.os == 'macOS'
env:
HOMEBREW_NO_AUTO_UPDATE: 1
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 1
- run: rustup toolchain install
- uses: taiki-e/install-action@v2
with:
tool: nextest@0.9
- uses: taiki-e/install-action@v2
with:
tool: cargo-llvm-cov@0.8
- name: Cache
uses: Swatinem/rust-cache@v2
- name: Run doctests
run: cargo test --doc
- name: Run tests
# Do not use `--all-targets` to avoid running benches
run: cargo llvm-cov nextest --release --features test-utils --bins --lib --examples --tests --codecov --output-path codecov.json
env:
LC_ALL: en_US.UTF-8
TERM: xterm-256color
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: codecov.json
fail_ci_if_error: false
continue-on-error: true
- name: Upload test results to Codecov
uses: codecov/codecov-action@v5
with:
report_type: test_results
token: ${{ secrets.CODECOV_TOKEN }}
files: target/nextest/default/junit.xml
fail_ci_if_error: false
continue-on-error: true
clippy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 1
- run: rustup toolchain install
- name: Cache
uses: Swatinem/rust-cache@v2
- name: Clippy
run: cargo clippy
rustfmt:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- run: rustup toolchain install
- name: Check formatting
run: |
cargo fmt --all -- --check
build-no-default-features:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- run: rustup toolchain install
- name: Cache
uses: Swatinem/rust-cache@v2
- name: Build without any feature
run: |
cargo build --no-default-features