-
Notifications
You must be signed in to change notification settings - Fork 1
112 lines (105 loc) · 2.92 KB
/
ci.yml
File metadata and controls
112 lines (105 loc) · 2.92 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
name: CI
on:
push:
branches: ["main"]
paths:
- "crates/**"
- "Cargo.toml"
- "Cargo.lock"
- ".github/workflows/ci.yml"
pull_request:
paths:
- "crates/**"
- "Cargo.toml"
- "Cargo.lock"
- ".github/workflows/ci.yml"
merge_group:
paths:
- "crates/**"
- "Cargo.toml"
- "Cargo.lock"
- ".github/workflows/ci.yml"
permissions:
contents: read
env:
RUSTFLAGS: -Dwarnings
RUST_BACKTRACE: full
jobs:
test:
name: Test (Rust ${{matrix.toolchain}}, target ${{matrix.target}})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
toolchain: ["nightly", "beta", "stable", "1.83.0"]
target: ["x86_64-unknown-linux-gnu", "x86_64-unknown-linux-musl"]
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{matrix.toolchain}}
components: llvm-tools, clippy, rust-src
- uses: taiki-e/install-action@v2
with:
tool: just,cargo-llvm-cov,cargo-nextest
- name: Enable type layout randomization
if: matrix.toolchain == 'nightly'
run: echo RUSTFLAGS=${RUSTFLAGS}\ -Zrandomize-layout >> $GITHUB_ENV
- run: sudo apt-get update && sudo apt-get install -y musl-tools
if: endsWith(matrix.target, 'musl')
- run: rustup target add ${{matrix.target}}
- run: just ci-test --target ${{matrix.target}}
docs:
name: Documentation
runs-on: ubuntu-latest
timeout-minutes: 45
env:
RUSTDOCFLAGS: -Dwarnings
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@nightly
- uses: dtolnay/install@cargo-docs-rs
- run: cargo docs-rs --package ktls-core
- run: cargo docs-rs --package ktls-stream
clippy:
name: Clippy
runs-on: ubuntu-latest
if: github.event_name != 'pull_request'
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.83.0
components: clippy
- uses: taiki-e/install-action@v2
with:
tool: just
- run: just clippy --all
coverage:
name: Coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
components: llvm-tools, clippy, rust-src
- uses: taiki-e/install-action@v2
with:
tool: just,cargo-llvm-cov,cargo-nextest
- run: just ci-test
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: hanyu-dev/ktls