CI #403
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
schedule: # https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#onschedule | |
- cron: '0 0 * * 0' # at midnight of each sunday | |
name: CI | |
jobs: | |
develop: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
toolchain: | |
- 1.60.0 # MSRV | |
- stable | |
- nightly | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ matrix.toolchain }} | |
components: rustfmt, clippy | |
- run: cargo fmt --all -- --check | |
- run: cargo clippy -- -D warnings | |
- run: cargo test --all-features | |
cross: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
target: | |
# copied from `rustup target list` | |
# - aarch64-apple-darwin # (build error) | |
# - aarch64-apple-ios # (build error) | |
# - aarch64-apple-ios-sim # (build error) | |
# - aarch64-fuchsia # (fuchsia does not have [sg]etrlimit) | |
- aarch64-linux-android | |
# - aarch64-pc-windows-msvc # (missing docker image) | |
- aarch64-unknown-linux-gnu | |
- aarch64-unknown-linux-musl | |
# - aarch64-unknown-none # (no std) | |
# - aarch64-unknown-none-softfloat # (no std) | |
- arm-linux-androideabi | |
- arm-unknown-linux-gnueabi # (libc mismatch) | |
- arm-unknown-linux-gnueabihf # (libc mismatch) | |
- arm-unknown-linux-musleabi | |
- arm-unknown-linux-musleabihf | |
# - armebv7r-none-eabi # (no std) | |
# - armebv7r-none-eabihf # (no std) | |
- armv5te-unknown-linux-gnueabi # (libc mismatch) | |
- armv5te-unknown-linux-musleabi | |
- armv7-linux-androideabi | |
# - armv7-unknown-linux-gnueabi # (missing docker image) | |
- armv7-unknown-linux-gnueabihf # (libc mismatch) | |
# - armv7-unknown-linux-musleabi # (missing docker image) | |
- armv7-unknown-linux-musleabihf | |
# - armv7a-none-eabi # (no std) | |
# - armv7r-none-eabi # (no std) | |
# - armv7r-none-eabihf # (no std) | |
# - asmjs-unknown-emscripten # (build error) | |
# - i586-pc-windows-msvc # (missing docker image) | |
- i586-unknown-linux-gnu # (libc mismatch) | |
- i586-unknown-linux-musl | |
- i686-linux-android | |
# - i686-pc-windows-gnu # (missing docker image) | |
# - i686-pc-windows-msvc # (missing docker image) | |
# - i686-unknown-freebsd # (missing docker image) | |
- i686-unknown-linux-gnu # (libc mismatch) | |
- i686-unknown-linux-musl | |
# - mips-unknown-linux-gnu # (rust-std unavailable) | |
# - mips-unknown-linux-musl # (rust-std unavailable) | |
# - mips64-unknown-linux-gnuabi64 # (rust-std unavailable) | |
# - mips64-unknown-linux-muslabi64 # (missing docker image) | |
# - mips64el-unknown-linux-gnuabi64 # (rust-std unavailable) | |
# - mips64el-unknown-linux-muslabi64 # (missing docker image) | |
# - mipsel-unknown-linux-gnu # (rust-std unavailable) | |
# - mipsel-unknown-linux-musl # (rust-std unavailable) | |
# - nvptx64-nvidia-cuda # (no std) | |
- powerpc-unknown-linux-gnu # (libc mismatch) | |
# - powerpc64-unknown-linux-gnu # (missing docker image) | |
- powerpc64le-unknown-linux-gnu | |
# - riscv32i-unknown-none-elf # (no std) | |
# - riscv32imac-unknown-none-elf # (no std) | |
# - riscv32imc-unknown-none-elf # (no std) | |
- riscv64gc-unknown-linux-gnu | |
# - riscv64gc-unknown-none-elf # (no std) | |
# - riscv64imac-unknown-none-elf # (no std) | |
- s390x-unknown-linux-gnu | |
# - sparc64-unknown-linux-gnu # (missing docker image) | |
# - sparcv9-sun-solaris # (build error) | |
# - thumbv6m-none-eabi # (no std) | |
# - thumbv7em-none-eabi # (no std) | |
# - thumbv7em-none-eabihf # (no std) | |
# - thumbv7m-none-eabi # (no std) | |
# - thumbv7neon-linux-androideabi # (missing docker image) | |
# - thumbv7neon-unknown-linux-gnueabihf # (missing docker image) | |
# - thumbv8m.base-none-eabi # (no std) | |
# - thumbv8m.main-none-eabi # (no std) | |
# - thumbv8m.main-none-eabihf # (no std) | |
# - wasm32-unknown-emscripten # (build error) | |
# - wasm32-unknown-unknown # (tester error) | |
# - wasm32-wasi # (tester error) | |
# - x86_64-apple-darwin # (build error) | |
# - x86_64-apple-ios # (build error) | |
# - x86_64-fortanix-unknown-sgx # (tester error) | |
# - x86_64-fuchsia # (fuchsia does not have [sg]etrlimit) | |
- x86_64-linux-android | |
# - x86_64-pc-solaris # (missing docker image) | |
# - x86_64-pc-windows-gnu # (other) | |
# - x86_64-pc-windows-msvc # (missing docker image) | |
# - x86_64-sun-solaris # (build error) | |
# - x86_64-unknown-freebsd # (missing docker image) | |
# - x86_64-unknown-illumos # (build error) | |
- x86_64-unknown-linux-gnu | |
# - x86_64-unknown-linux-gnux32 # (missing docker image) | |
- x86_64-unknown-linux-musl | |
# - x86_64-unknown-netbsd # (tester error) | |
# - x86_64-unknown-redox # (nightly) | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: ${{ matrix.target }} | |
- uses: taiki-e/install-action@v2 | |
with: | |
tool: cross | |
- name: cross test | |
run: | | |
# TODO: remove this when `cross` updates | |
# See https://github.com/cross-rs/cross/issues/1217 | |
export CROSS_TARGET_AARCH64_LINUX_ANDROID_IMAGE="ghcr.io/cross-rs/aarch64-linux-android:main" | |
export CROSS_TARGET_I686_LINUX_ANDROID_IMAGE="ghcr.io/cross-rs/i686-linux-android:main" | |
export CROSS_TARGET_X86_64_LINUX_ANDROID_IMAGE="ghcr.io/cross-rs/x86_64-linux-android:main" | |
cross test --all-features --target=${{ matrix.target }} | |
macos: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- run: | | |
cargo test --all-features | |
windows: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- run: | | |
cargo test --all-features | |
ubuntu: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: x86_64-apple-darwin | |
- run: | | |
cargo test --all-features | |
- run: | | |
cargo check --target x86_64-apple-darwin | |
diff-codegen: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- name: diff | |
run: | | |
./scripts/codegen.sh | |
[[ -z $(git status -s) ]] # Fail if changed. See https://stackoverflow.com/a/9393642 |