-
Notifications
You must be signed in to change notification settings - Fork 0
113 lines (100 loc) · 2.84 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
name: ci
on:
push:
branches:
- "master"
- "**_ci"
pull_request:
schedule:
- cron: "0 1 * * 0"
env:
CARGO_TERM_COLOR: always
jobs:
ci:
runs-on: ${{ matrix.runs_on }}
strategy:
matrix:
rust:
- stable
- beta
- 1.74.0 # MSRV
runs_on:
- ubuntu-latest
- windows-latest
- macos-latest
feature:
- net-std
- net-async-std
- net-tokio
- net-smol
- default
include:
- runs_on: ubuntu-latest
feature: net-tokio,socket2
rust: stable
- runs_on: ubuntu-latest
feature: net-tokio,socket2
rust: beta
- runs_on: ubuntu-latest
feature: net-tokio,socket2
rust: 1.74.0 # MSRV
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: dtolnay/rust-toolchain@v1
with:
toolchain: ${{ matrix.rust }}
components: rustfmt,clippy
- name: build ch4
run: cargo build --no-default-features --features ${{ matrix.feature }}
- name: show ch4 info
if: ${{ !(matrix.feature == 'net-async-std' && matrix.runs_on == 'windows-latest') }}
env:
RUST_BACKTRACE: "full"
run: cargo run --no-default-features --features ${{ matrix.feature }} -- --info
- name: ch4 list nameservers
if: ${{ !(matrix.feature == 'net-async-std' && matrix.runs_on == 'windows-latest') }}
env:
RUST_BACKTRACE: "full"
run: cargo run --no-default-features --features ${{ matrix.feature }} -- --list-nameservers
- name: test ch4
run: cargo test --no-default-features --features ${{ matrix.feature }}
- name: lint ch4
run: cargo clippy --no-default-features --features ${{ matrix.feature }} -- -D warnings
no-rustfmt:
runs-on: ubuntu-latest
env:
RUSTFLAGS: --deny warnings
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@v1
with:
toolchain: stable
- name: remove rustfmt
run: |
if which rustfmt; then
rm $(which rustfmt)
echo "remove-rustfmt: OK"
fi
if which rustfmt; then
echo "remove-rustfmt: VERIFY ERR"
exit 1
fi
shell: bash
- name: build without rustfmt
run: cargo build --all-targets
- name: test without rustfmt
run: cargo build --all-targets
- name: check without rustfmt
run: cargo check --all-targets
common-ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@v1
with:
toolchain: nightly
components: rustfmt
- name: format all
run: cargo fmt -- --check