| 1 |
on: |
| 2 |
push: |
| 3 |
branches: |
| 4 |
- main |
| 5 |
pull_request: |
| 6 |
branches: |
| 7 |
- main |
| 8 |
schedule: # https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#onschedule |
| 9 |
- cron: '0 0 * * 0' # at midnight of each sunday |
| 10 |
|
| 11 |
|
| 12 |
name: CI |
| 13 |
|
| 14 |
permissions: |
| 15 |
contents: read |
| 16 |
|
| 17 |
jobs: |
| 18 |
develop: |
| 19 |
runs-on: ubuntu-latest |
| 20 |
steps: |
| 21 |
- uses: actions/checkout@v6 |
| 22 |
- uses: dtolnay/rust-toolchain@nightly |
| 23 |
with: |
| 24 |
components: rustfmt, clippy |
| 25 |
- uses: Swatinem/rust-cache@v2 |
| 26 |
- run: cargo fmt --all -- --check |
| 27 |
- run: cargo clippy -- -D warnings |
| 28 |
- run: cargo test --all-features |
| 29 |
|
| 30 |
msrv: |
| 31 |
runs-on: ubuntu-latest |
| 32 |
strategy: |
| 33 |
fail-fast: false |
| 34 |
matrix: |
| 35 |
toolchain: |
| 36 |
- 1.65.0 # MSRV |
| 37 |
- stable |
| 38 |
steps: |
| 39 |
- uses: actions/checkout@v6 |
| 40 |
- uses: taiki-e/install-action@just |
| 41 |
- uses: dtolnay/rust-toolchain@master |
| 42 |
with: |
| 43 |
toolchain: ${{ matrix.toolchain }} |
| 44 |
- uses: Swatinem/rust-cache@v2 |
| 45 |
- run: cargo test -p rlimit --all-features |
| 46 |
|
| 47 |
cross: |
| 48 |
runs-on: ubuntu-latest |
| 49 |
strategy: |
| 50 |
fail-fast: false |
| 51 |
matrix: |
| 52 |
target: |
| 53 |
# copied from `rustup target list` |
| 54 |
# - aarch64-apple-darwin # (build error) |
| 55 |
# - aarch64-apple-ios # (build error) |
| 56 |
# - aarch64-apple-ios-sim # (build error) |
| 57 |
# - aarch64-fuchsia # (fuchsia does not have [sg]etrlimit) |
| 58 |
- aarch64-linux-android |
| 59 |
# - aarch64-pc-windows-msvc # (missing docker image) |
| 60 |
- aarch64-unknown-linux-gnu |
| 61 |
- aarch64-unknown-linux-musl |
| 62 |
# - aarch64-unknown-none # (no std) |
| 63 |
# - aarch64-unknown-none-softfloat # (no std) |
| 64 |
- arm-linux-androideabi |
| 65 |
- arm-unknown-linux-gnueabi # (libc mismatch) |
| 66 |
- arm-unknown-linux-gnueabihf # (libc mismatch) |
| 67 |
- arm-unknown-linux-musleabi |
| 68 |
- arm-unknown-linux-musleabihf |
| 69 |
# - armebv7r-none-eabi # (no std) |
| 70 |
# - armebv7r-none-eabihf # (no std) |
| 71 |
- armv5te-unknown-linux-gnueabi # (libc mismatch) |
| 72 |
- armv5te-unknown-linux-musleabi |
| 73 |
- armv7-linux-androideabi |
| 74 |
# - armv7-unknown-linux-gnueabi # (missing docker image) |
| 75 |
- armv7-unknown-linux-gnueabihf # (libc mismatch) |
| 76 |
# - armv7-unknown-linux-musleabi # (missing docker image) |
| 77 |
- armv7-unknown-linux-musleabihf |
| 78 |
# - armv7a-none-eabi # (no std) |
| 79 |
# - armv7r-none-eabi # (no std) |
| 80 |
# - armv7r-none-eabihf # (no std) |
| 81 |
# - asmjs-unknown-emscripten # (build error) |
| 82 |
# - i586-pc-windows-msvc # (missing docker image) |
| 83 |
- i586-unknown-linux-gnu # (libc mismatch) |
| 84 |
- i586-unknown-linux-musl |
| 85 |
- i686-linux-android |
| 86 |
# - i686-pc-windows-gnu # (missing docker image) |
| 87 |
# - i686-pc-windows-msvc # (missing docker image) |
| 88 |
# - i686-unknown-freebsd # (missing docker image) |
| 89 |
- i686-unknown-linux-gnu # (libc mismatch) |
| 90 |
- i686-unknown-linux-musl |
| 91 |
# - mips-unknown-linux-gnu # (rust-std unavailable) |
| 92 |
# - mips-unknown-linux-musl # (rust-std unavailable) |
| 93 |
# - mips64-unknown-linux-gnuabi64 # (rust-std unavailable) |
| 94 |
# - mips64-unknown-linux-muslabi64 # (missing docker image) |
| 95 |
# - mips64el-unknown-linux-gnuabi64 # (rust-std unavailable) |
| 96 |
# - mips64el-unknown-linux-muslabi64 # (missing docker image) |
| 97 |
# - mipsel-unknown-linux-gnu # (rust-std unavailable) |
| 98 |
# - mipsel-unknown-linux-musl # (rust-std unavailable) |
| 99 |
# - nvptx64-nvidia-cuda # (no std) |
| 100 |
- powerpc-unknown-linux-gnu # (libc mismatch) |
| 101 |
# - powerpc64-unknown-linux-gnu # (missing docker image) |
| 102 |
- powerpc64le-unknown-linux-gnu |
| 103 |
# - riscv32i-unknown-none-elf # (no std) |
| 104 |
# - riscv32imac-unknown-none-elf # (no std) |
| 105 |
# - riscv32imc-unknown-none-elf # (no std) |
| 106 |
- riscv64gc-unknown-linux-gnu |
| 107 |
# - riscv64gc-unknown-none-elf # (no std) |
| 108 |
# - riscv64imac-unknown-none-elf # (no std) |
| 109 |
- s390x-unknown-linux-gnu |
| 110 |
# - sparc64-unknown-linux-gnu # (missing docker image) |
| 111 |
# - sparcv9-sun-solaris # (build error) |
| 112 |
# - thumbv6m-none-eabi # (no std) |
| 113 |
# - thumbv7em-none-eabi # (no std) |
| 114 |
# - thumbv7em-none-eabihf # (no std) |
| 115 |
# - thumbv7m-none-eabi # (no std) |
| 116 |
# - thumbv7neon-linux-androideabi # (missing docker image) |
| 117 |
# - thumbv7neon-unknown-linux-gnueabihf # (missing docker image) |
| 118 |
# - thumbv8m.base-none-eabi # (no std) |
| 119 |
# - thumbv8m.main-none-eabi # (no std) |
| 120 |
# - thumbv8m.main-none-eabihf # (no std) |
| 121 |
# - wasm32-unknown-emscripten # (build error) |
| 122 |
# - wasm32-unknown-unknown # (tester error) |
| 123 |
# - wasm32-wasi # (tester error) |
| 124 |
# - x86_64-apple-darwin # (build error) |
| 125 |
# - x86_64-apple-ios # (build error) |
| 126 |
# - x86_64-fortanix-unknown-sgx # (tester error) |
| 127 |
# - x86_64-fuchsia # (fuchsia does not have [sg]etrlimit) |
| 128 |
- x86_64-linux-android |
| 129 |
# - x86_64-pc-solaris # (missing docker image) |
| 130 |
# - x86_64-pc-windows-gnu # (other) |
| 131 |
# - x86_64-pc-windows-msvc # (missing docker image) |
| 132 |
# - x86_64-sun-solaris # (build error) |
| 133 |
# - x86_64-unknown-freebsd # (missing docker image) |
| 134 |
# - x86_64-unknown-illumos # (build error) |
| 135 |
- x86_64-unknown-linux-gnu |
| 136 |
# - x86_64-unknown-linux-gnux32 # (missing docker image) |
| 137 |
- x86_64-unknown-linux-musl |
| 138 |
# - x86_64-unknown-netbsd # (tester error) |
| 139 |
# - x86_64-unknown-redox # (nightly) |
| 140 |
|
| 141 |
steps: |
| 142 |
- uses: actions/checkout@v6 |
| 143 |
- uses: dtolnay/rust-toolchain@stable |
| 144 |
with: |
| 145 |
targets: ${{ matrix.target }} |
| 146 |
- uses: taiki-e/install-action@v2 |
| 147 |
with: |
| 148 |
tool: cross |
| 149 |
- name: cross test |
| 150 |
run: | |
| 151 |
# TODO: remove this when `cross` updates |
| 152 |
# See https://github.com/cross-rs/cross/issues/1217 |
| 153 |
export CROSS_TARGET_AARCH64_LINUX_ANDROID_IMAGE="ghcr.io/cross-rs/aarch64-linux-android:main" |
| 154 |
export CROSS_TARGET_I686_LINUX_ANDROID_IMAGE="ghcr.io/cross-rs/i686-linux-android:main" |
| 155 |
export CROSS_TARGET_X86_64_LINUX_ANDROID_IMAGE="ghcr.io/cross-rs/x86_64-linux-android:main" |
| 156 |
|
| 157 |
cross test --all-features --target=${{ matrix.target }} |
| 158 |
|
| 159 |
macos: |
| 160 |
strategy: |
| 161 |
fail-fast: false |
| 162 |
matrix: |
| 163 |
include: |
| 164 |
- runner: macos-latest |
| 165 |
- runner: macos-15-intel |
| 166 |
runs-on: ${{ matrix.runner }} |
| 167 |
steps: |
| 168 |
- uses: actions/checkout@v6 |
| 169 |
- uses: dtolnay/rust-toolchain@stable |
| 170 |
- run: | |
| 171 |
cargo test --all-features |
| 172 |
|
| 173 |
windows: |
| 174 |
runs-on: windows-latest |
| 175 |
steps: |
| 176 |
- uses: actions/checkout@v6 |
| 177 |
- uses: dtolnay/rust-toolchain@stable |
| 178 |
- run: | |
| 179 |
cargo test --all-features |
| 180 |
|
| 181 |
ubuntu: |
| 182 |
runs-on: ubuntu-latest |
| 183 |
steps: |
| 184 |
- uses: actions/checkout@v6 |
| 185 |
- uses: dtolnay/rust-toolchain@stable |
| 186 |
- run: | |
| 187 |
cargo test --all-features |
| 188 |
|
| 189 |
diff-codegen: |
| 190 |
runs-on: ubuntu-latest |
| 191 |
steps: |
| 192 |
- uses: actions/checkout@v6 |
| 193 |
- uses: dtolnay/rust-toolchain@stable |
| 194 |
- name: diff |
| 195 |
run: | |
| 196 |
./scripts/codegen.sh |
| 197 |
[[ -z $(git status -s) ]] # Fail if changed. See https://stackoverflow.com/a/9393642 |
| 198 |
|
| 199 |
bsd: |
| 200 |
runs-on: ubuntu-latest |
| 201 |
permissions: |
| 202 |
contents: read |
| 203 |
strategy: |
| 204 |
fail-fast: false |
| 205 |
matrix: |
| 206 |
os: |
| 207 |
- name: freebsd |
| 208 |
version: '14.3' |
| 209 |
- name: netbsd |
| 210 |
version: '10.1' |
| 211 |
# - name: openbsd |
| 212 |
# version: '7.8' |
| 213 |
steps: |
| 214 |
- uses: actions/checkout@v6 |
| 215 |
- name: Test on ${{ matrix.os.name }} |
| 216 |
uses: cross-platform-actions/[email protected] |
| 217 |
with: |
| 218 |
operating_system: ${{ matrix.os.name }} |
| 219 |
version: ${{ matrix.os.version }} |
| 220 |
run: | |
| 221 |
uname -a |
| 222 |
# Install curl if needed (NetBSD may not have it by default) |
| 223 |
if ! command -v curl > /dev/null 2>&1; then |
| 224 |
if command -v pkgin > /dev/null 2>&1; then |
| 225 |
sudo pkgin -y install curl |
| 226 |
elif command -v pkg_add > /dev/null 2>&1; then |
| 227 |
sudo pkg_add -v curl |
| 228 |
elif command -v pkg > /dev/null 2>&1; then |
| 229 |
sudo pkg install -y curl |
| 230 |
fi |
| 231 |
fi |
| 232 |
# Install rustup |
| 233 |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable --profile minimal |
| 234 |
. "$HOME/.cargo/env" |
| 235 |
rustc --version |
| 236 |
cargo --version |
| 237 |
cargo test --all-features |