-
Notifications
You must be signed in to change notification settings - Fork 0
151 lines (137 loc) · 3.9 KB
/
devel.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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
name: devel
on:
pull_request:
paths:
- .github/workflows/devel.yml
- .cargo/config.toml
- Cargo.lock
- Cargo.toml
- src/**
push:
branches:
- master
- staging
- trying
paths:
- .github/workflows/devel.yml
- Cargo.lock
- Cargo.toml
- src/**
schedule:
- cron: '15 01 * * *' # Every day at 01:15 UTC
jobs:
test:
name: test
runs-on: ${{ matrix.os }}
env:
# Cargo binary
CARGO_BIN: cargo
# When CARGO_BIN is set to CROSS, this is set to `--target matrix.target`
TARGET_FLAGS: ""
# When CARGO_BIN is set to CROSS, TARGET_DIR includes matrix.target
TARGET_DIR: ./target
# Emit backtraces on panics
RUST_BACKTRACE: 1
# Skip tests
SKIP_TESTS: ""
strategy:
matrix:
build:
- pinned
- linux-musl
- linux-gnu
- macos
- windows-msvc
include:
# Specific Rust channels.
# We test against the latest and minimum Rust stable version.
- build: pinned
os: ubuntu-22.04
rust: 1.70.0
# Some of our release builds are generated by a nightly compiler to take
# advantage of the latest optimizations/compile time improvements.
- build: linux-musl
os: ubuntu-22.04
rust: stable
target: x86_64-unknown-linux-musl
- build: linux-gnu
os: ubuntu-22.04
rust: stable
target: x86_64-unknown-linux-gnu
- build: macos
os: macos-12
rust: stable
target: x86_64-apple-darwin
- build: windows-msvc
os: windows-2022
rust: stable
target: x86_64-pc-windows-msvc
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.rust }}
target: ${{ matrix.target }}
- name: Set up Cross
if: ${{ !contains(matrix.os, 'windows') && matrix.target != '' }}
shell: bash
run: |
target=''
case "${{ matrix.os }}" in
*macos*)
target=x86_64-apple-darwin
;;
*)
target=x86_64-unknown-linux-musl
;;
esac
echo "Installing cross..."
curl -sSL \
"https://github.com/cross-rs/cross/releases/download/v0.2.5/cross-$target.tar.gz" \
| sudo tar zxf - -C /usr/local/bin/ cross cross-util
cross -V
echo "CARGO_BIN=/usr/local/bin/cross" >> $GITHUB_ENV
- name: Setup Cargo
shell: bash
run: |
if [[ "${{ matrix.target }}" != "" ]]; then
echo "TARGET_FLAGS=--target=${{ matrix.target }}" >> $GITHUB_ENV
echo "TARGET_DIR=./target/${{ matrix.target }}" >> $GITHUB_ENV
fi
echo "cargo command is: ${{ env.CARGO_BIN }}"
echo "target flag is: ${{ env.TARGET_FLAGS }}"
echo "target dir is: ${{ env.TARGET_DIR }}"
- name: Run tests
shell: bash
run: |
${{ env.CARGO_BIN }} test --verbose ${{ env.TARGET_FLAGS }} ${{ env.SKIP_TESTS }}
- name: Run build
shell: bash
run: |
${{ env.CARGO_BIN }} build --example server --verbose ${{ env.TARGET_FLAGS }}
checks:
name: checks
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
components: rustfmt, clippy
- name: Check formatting
run: |
cargo fmt --all -- --check
- name: Check via Clippy
run: |
cargo clippy --all-features -- -D warnings
- name: Check crate docs
run: |
cargo doc --lib --no-deps