-
Notifications
You must be signed in to change notification settings - Fork 2
87 lines (73 loc) · 1.68 KB
/
Copy pathci.yml
File metadata and controls
87 lines (73 loc) · 1.68 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
name: CI
on:
pull_request:
push:
branches:
- main
tags:
- "*"
workflow_dispatch:
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
jobs:
test:
name: Test (${{ matrix.name }})
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
- name: macOS Sequoia
runner: macos-15
- name: macOS Tahoe
runner: macos-26
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install Rust
run: |
rustup update stable
rustup default stable
- name: Test
run: cargo test -- --test-threads 1
lint:
name: Lint
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install Rust
run: |
rustup update stable
rustup default stable
rustup component add rustfmt clippy
- name: Check formatting
run: cargo fmt --check
- name: Check lints
run: cargo clippy --all-targets -- -D warnings
publish:
name: Publish
runs-on: macos-latest
needs:
- lint
- test
if: startsWith(github.ref, 'refs/tags/')
permissions:
contents: read
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install Rust
run: |
rustup update stable
rustup default stable
- name: Authenticate with crates.io
id: auth
uses: rust-lang/crates-io-auth-action@v1
- name: Publish crates
env:
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
run: cargo publish --workspace