-
Notifications
You must be signed in to change notification settings - Fork 0
150 lines (126 loc) · 3.7 KB
/
ci.yaml
File metadata and controls
150 lines (126 loc) · 3.7 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
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
name: CI/CD
on:
pull_request:
push:
branches:
- main
env:
RUSTUP_MAX_RETRIES: 10
MSRV: 1.85.0 # (keep this in sync with `Cargo.toml`'s `rust-version`)
# Tests have to run as root on GHA since the VM image is very restrictive about
# who can open "fun" device files like `/dev/uinput`.
CICD_SUDO: 1
jobs:
msrv:
name: MSRV
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust toolchain
run: |
rustup install ${{ env.MSRV }} --profile=minimal
rustup default ${{ env.MSRV }}
rustup install nightly --profile=minimal
- name: Install CI/CD tooling
run: cargo install sludge-cicd --debug
- name: Run CI/CD
run: sludge-cicd
env:
CICD_SKIP_DOCS: 1
build:
name: Build only
strategy:
matrix:
include:
- os: ubuntu-latest
target: i686-unknown-linux-gnu
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust toolchain
run: |
rustup install stable --profile=minimal
rustup install nightly --profile=minimal
- name: Install Rust target
run: rustup target add ${{ matrix.target }}
- name: Build the library
run: |
cargo build --target ${{ matrix.target }}
cargo build --target ${{ matrix.target }} --features tokio
cargo build --target ${{ matrix.target }} --features async-io
freebsd:
runs-on: ubuntu-latest
name: Test on FreeBSD
timeout-minutes: 10 # this occasionally hangs forever, so cancel it quickly
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Test
id: test
uses: vmactions/freebsd-vm@v1.2.1
with:
sync: rsync
copyback: false
prepare: |
pkg install -y rustup-init
rustup-init -y --profile minimal
run: |
rustup target add i686-unknown-freebsd
rustup --version
rustc --version
cargo test
ci:
name: CI
strategy:
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- os: ubuntu-latest
target: x86_64-unknown-linux-musl
- os: ubuntu-latest
target: i686-unknown-linux-musl
- os: ubuntu-24.04-arm
target: aarch64-unknown-linux-gnu
- os: ubuntu-24.04-arm
target: aarch64-unknown-linux-musl
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust toolchain
run: |
rustup install stable --profile=minimal
rustup install nightly --profile=minimal
- name: Install Rust target
run: rustup target add ${{ matrix.target }}
- name: Install CI/CD tooling
run: cargo install sludge-cicd --debug
- name: Run CI
run: sludge-cicd --target ${{ matrix.target }}
env:
CICD_SKIP_DOCS: 1
cd:
name: CD
needs: [msrv, build, ci, freebsd]
runs-on: ubuntu-latest
permissions:
contents: write # pushes tags to the repo
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Rust toolchain
run: |
rustup install stable --profile=minimal
rustup install nightly --profile=minimal
- name: Install CI/CD tooling
run: cargo install sludge-cicd --debug
- name: Run CI/CD
run: sludge-cicd --features serde,tokio # features for the docs build
env:
CRATES_IO_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}