-
Notifications
You must be signed in to change notification settings - Fork 0
91 lines (87 loc) · 2.9 KB
/
ci.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
on:
push:
branches:
- main
pull_request:
name: CI
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
env:
RUSTFLAGS: -D warnings
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3
- name: Install just, cargo-hack, and cargo-sync-rdme
uses: taiki-e/install-action@v2
with:
tool: just,cargo-hack,cargo-sync-rdme
- name: Lint (clippy)
run: just powerset clippy --all-targets
- name: Lint (rustfmt)
run: cargo xfmt --check
- name: Run rustdoc
run: just rustdoc
- name: Install nightly toolchain for cargo-sync-rdme
uses: dtolnay/rust-toolchain@nightly
- name: Regenerate readmes
run: just generate-readmes
- name: Check for differences
run: git diff --exit-code
build-and-test:
name: Build and test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
fail-fast: false
env:
RUSTFLAGS: -D warnings
CARGO_TERM_COLOR: always
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4
- name: Install toolchain in rust-toolchain.toml
# GitHub Actions has an older rustup as of 2025-03-07 which doesn't accept
# `rustup toolchain install` with no arguments. Update rustup first.
run: rustup self update && rustup toolchain install
- uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2
- uses: taiki-e/install-action@cargo-hack
- uses: taiki-e/install-action@just
- uses: taiki-e/install-action@nextest
- name: Build
run: just powerset build
- name: Run tests
run: just powerset nextest run
- name: Doctests
run: just powerset test --doc
build-and-test-msrv:
name: Build and test (MSRV)
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
# 1.81 is the MSRV
rust-version: ["1.81"]
fail-fast: false
env:
RUSTFLAGS: -D warnings
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust-version }}
- uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2
- uses: taiki-e/install-action@cargo-hack
- uses: taiki-e/install-action@just
- uses: taiki-e/install-action@nextest
- name: Build
run: just powerset build
# We don't run ui_test on the MSRV since compiler output varies by version.
- name: Test without ui_test
run: just powerset nextest run -E 'not binary(ui_test)'
- name: Doctests
run: just powerset test --doc