-
Notifications
You must be signed in to change notification settings - Fork 188
134 lines (127 loc) · 3.61 KB
/
ci.yml
File metadata and controls
134 lines (127 loc) · 3.61 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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
name: Continuous Integration
on:
pull_request:
merge_group:
push:
branches: [main]
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
msrv:
name: Build with MSRV
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v6
- uses: Swatinem/rust-cache@v2
- name: Get current MSRV from Cargo.toml
id: current_msrv
run: |
msrv=$(cat Cargo.toml | grep rust-version | sed 's/.* = "//; s/"//')
echo "msrv=$msrv" >> $GITHUB_OUTPUT
- name: Setup Rust version
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{steps.current_msrv.outputs.msrv}}
- uses: Swatinem/rust-cache@v2.7.3
- uses: taiki-e/install-action@v2
with:
tool: cargo-hack
- name: Build
run: cargo hack build --feature-powerset --depth 2 --clean-per-run
test:
name: Test
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
toolchain:
- stable
- nightly
partition:
- 1/4
- 2/4
- 3/4
- 4/4
steps:
- name: Checkout sources
uses: actions/checkout@v6
- uses: Swatinem/rust-cache@v2
- name: Setup Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
- name: Enable Docker Remote API on Localhost
shell: bash
run: |
sudo mkdir -p /etc/systemd/system/docker.service.d/
sudo cp ./.github/docker.override.conf /etc/systemd/system/docker.service.d/override.conf
sudo systemctl daemon-reload
sudo systemctl restart docker
- uses: taiki-e/install-action@v2
with:
tool: cargo-hack
- uses: taiki-e/install-action@v2
with:
tool: cargo-nextest
- name: Tests
run: cargo hack nextest run --feature-powerset --depth 2 --clean-per-run --partition ${{ matrix.partition }}
- name: Doc tests
if: matrix.toolchain == 'stable' && matrix.partition == '1/4'
run: cargo test --doc --workspace --all-features
fmt:
name: Rustfmt check
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v6
- uses: Swatinem/rust-cache@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
components: rustfmt
override: true
- name: Rustfmt check
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
clippy:
name: Clippy check
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
toolchain:
- stable
- nightly
steps:
- name: Checkout sources
uses: actions/checkout@v6
- uses: Swatinem/rust-cache@v2
- name: Setup Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
components: clippy
- name: Clippy check
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features
prlint:
name: PR name check
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: CondeNast/conventional-pull-request-action@v0.2.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
# For PRs we gonna use squash-strategy, so commits names not so matter
ignoreCommits: "true"