-
Notifications
You must be signed in to change notification settings - Fork 2
109 lines (101 loc) · 2.55 KB
/
ci.yaml
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
name: ci
on:
pull_request:
push:
branches:
- main
jobs:
test:
name: test
runs-on: ${{ matrix.os }}
strategy:
matrix:
build:
- pinned
- pinned-win
- stable
- beta
- nightly
- macos
- win-msvc
# - win-gnu
include:
- build: pinned
os: ubuntu-22.04
rust: 1.81.0
- build: pinned-win
os: windows-2019
rust: 1.81.0
- build: stable
os: ubuntu-22.04
rust: stable
- build: beta
os: ubuntu-22.04
rust: beta
- build: nightly
os: ubuntu-22.04
rust: nightly
- build: macos
os: macos-latest
rust: stable
- build: win-msvc
os: windows-2019
rust: stable
# - build: win-gnu
# os: windows-2019
# rust: stable-x86_64-gnu
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
override: true
- run: cargo build --verbose
- run: cargo doc --verbose
- run: cargo test --verbose -- --test-threads 1
rustfmt:
name: rustfmt
runs-on: ubuntu-22.04
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Install stable toolchain with rustfmt
uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: rustfmt
override: true
- name: Check formatting
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
clippy:
name: clippy
runs-on: ubuntu-22.04
permissions:
checks: write
steps:
- uses: actions/checkout@v3
- run: rustup component add clippy
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features -- --deny warnings
publish:
name: publish
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-22.04
needs: [clippy, test]
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- uses: katyo/publish-crates@v1
with:
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
ignore-unpublished-changes: true