-
Notifications
You must be signed in to change notification settings - Fork 73
91 lines (85 loc) · 2.75 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
name: CI
on:
workflow_dispatch:
push:
branches: [master]
paths-ignore:
- '**/*.md'
pull_request:
types: [opened, synchronize]
paths-ignore:
- '**/*.md'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: ${{ github.ref_name != 'master' }}
jobs:
test:
name: Test
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
runs-on: ${{ matrix.os }}
if: ${{ !startsWith(github.event.head_commit.message, 'release:') && !startsWith(github.event.head_commit.message, 'ci:') && !startsWith(github.event.head_commit.message, 'docs:') }}
steps:
- uses: actions/checkout@v4
- name: Install Rust Toolchain
uses: ./.github/actions/rustup
with:
clippy: true
save-cache: ${{ github.ref_name == 'master' }}
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/setup-node@v3
with:
node-version: 18
cache: "pnpm"
token: ${{ secrets.GH_DOTCOM_TOKEN }}
- run: pnpm i --no-lockfile
- name: Install cargo-nextest
uses: taiki-e/install-action@cargo-nextest
- name: Test
shell: bash
run: cargo nextest run
lint:
name: Clippy
runs-on: ubuntu-latest
if: ${{ !startsWith(github.event.head_commit.message, 'release:') && !startsWith(github.event.head_commit.message, 'ci:') && !startsWith(github.event.head_commit.message, 'docs:') }}
steps:
- uses: actions/checkout@v4
- name: Install Rust Toolchain
uses: ./.github/actions/rustup
with:
clippy: true
restore-cache: false
- name: Clippy
run: cargo clippy --locked -- -D warnings
format:
name: Format
runs-on: ubuntu-latest
if: ${{ !startsWith(github.event.head_commit.message, 'release:') && !startsWith(github.event.head_commit.message, 'ci:') && !startsWith(github.event.head_commit.message, 'docs:') }}
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: ./.github/actions/rustup
with:
fmt: true
restore-cache: false
- run: cargo fmt --all -- --check
- name: Install Taplo CLI
uses: ./.github/actions/binstall
with:
packages: [email protected]
- run: taplo format --check
typos:
name: Spell Check
runs-on: ubuntu-latest
if: ${{ !startsWith(github.event.head_commit.message, 'release:') && !startsWith(github.event.head_commit.message, 'ci:') && !startsWith(github.event.head_commit.message, 'docs:') }}
steps:
- uses: actions/checkout@v4
- uses: crate-ci/[email protected]
with:
files: .