-
-
Notifications
You must be signed in to change notification settings - Fork 0
120 lines (120 loc) · 3.36 KB
/
Copy pathci.yaml
File metadata and controls
120 lines (120 loc) · 3.36 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
name: CI
on:
push:
branches:
- main
tags:
- v*
pull_request:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions-rust-lang/setup-rust-toolchain@v1
- run: cargo fmt --all --check
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions-rust-lang/setup-rust-toolchain@v1
- run: cargo clippy --workspace --all-targets --all-features --locked -- -D warnings
cov:
permissions:
id-token: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions-rust-lang/setup-rust-toolchain@v1
- uses: taiki-e/install-action@v2
with:
tool: |
cargo-llvm-cov
cargo-nextest
- run: mkdir -p target/llvm-cov
- run: cargo llvm-cov nextest --workspace --all-targets --all-features --locked --fail-under-regions 90 --codecov --output-path target/llvm-cov/codecov.json
- if: github.ref_type != 'tag'
uses: codecov/codecov-action@v5
with:
fail_ci_if_error: true
use_oidc: true
report_type: coverage
disable_search: true
files: target/llvm-cov/codecov.json
- if: github.ref_type != 'tag'
uses: codecov/codecov-action@v5
with:
fail_ci_if_error: true
use_oidc: true
report_type: test_results
disable_search: true
files: target/nextest/default/junit.xml
publish:
if: github.ref_type == 'tag'
needs:
- fmt
- clippy
- cov
environment: publish
permissions:
id-token: write
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions-rust-lang/setup-rust-toolchain@v1
- uses: rust-lang/crates-io-auth-action@v1
id: auth
- run: cargo publish --workspace --all-features --locked
env:
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
- uses: taiki-e/create-gh-release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
binaries:
needs:
- publish
permissions:
contents: write
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
- target: aarch64-unknown-linux-gnu
os: ubuntu-24.04-arm
- target: x86_64-apple-darwin
os: macos-latest
- target: aarch64-apple-darwin
os: macos-latest
- target: x86_64-pc-windows-msvc
os: windows-latest
- target: aarch64-pc-windows-msvc
os: windows-11-arm
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v7
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
target: ${{ matrix.target }}
- if: runner.os == 'macOS'
run: brew install lld
- uses: taiki-e/upload-rust-binary-action@v1
with:
bin: commit-lint
archive: atypical-commit-$tag-$target
package: atypical-commit
locked: true
target: ${{ matrix.target }}
checksum: sha256