Skip to content

Commit

Permalink
Switch CI from github workflows to Cirrus
Browse files Browse the repository at this point in the history
Github workflows is currently broken, and I lack the knowledge to fix
it.  Also, Cirrus has one major advantage over GWF: native support for
FreeBSD.
  • Loading branch information
asomers committed Sep 29, 2024
1 parent f22cb01 commit 3b8b89c
Show file tree
Hide file tree
Showing 7 changed files with 91 additions and 180 deletions.
91 changes: 91 additions & 0 deletions .cirrus.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
setup: &SETUP
env:
HOME: /tmp # cargo needs it
RUSTFLAGS: -D warnings
setup_script:
- pkg install -y llvm
- fetch https://sh.rustup.rs -o rustup.sh
- sh rustup.sh -y --profile=minimal --default-toolchain $VERSION

task:
env:
HOME: /tmp # cargo cache needs it
TARGET: x86_64-unknown-freebsd
VERSION: nightly
matrix:
- name: FreeBSD 13 amd64 nightly
freebsd_instance:
image: freebsd-13-4-release-amd64
- name: FreeBSD 14 amd64 nightly
freebsd_instance:
image: freebsd-14-1-release-amd64-ufs
- name: FreeBSD 14 amd64 stable
env:
VERSION: 1.70.0
freebsd_instance:
image: freebsd-14-1-release-amd64-ufs
- name: FreeBSD 14 i686 nightly
# Test i686 FreeBSD in 32-bit emulation on a 64-bit host.
env:
TARGET: i686-unknown-freebsd
# Can't use nightly on i686 due to
# https://github.com/rust-lang/rust/issues/130677
VERSION: 1.70.0
freebsd_instance:
image: freebsd-14-1-release-amd64-ufs
<< : *SETUP
extra_setup_script:
- . $HOME/.cargo/env
- if [ "$TARGET" = "i686-unknown-freebsd" ]; then rustup target add --toolchain $VERSION i686-unknown-freebsd; fi
cargo_cache:
folder: $HOME/.cargo/registry
fingerprint_script: cat Cargo.lock || echo ""
test_script:
- . $HOME/.cargo/env
- cargo test --all-features --target $TARGET
doc_script:
- . $HOME/.cargo/env
- cargo doc --target $TARGET --no-deps --all-features
before_cache_script: rm -rf $HOME/.cargo/registry/index

# Stuff that doesn't need to be repeated for each target, env, and toolchain
lint_task:
name: Lint
env:
HOME: /tmp # cargo cache needs it
VERSION: nightly
freebsd_instance:
image: freebsd-14-1-release-amd64-ufs
<< : *SETUP
extra_setup_script:
- . $HOME/.cargo/env
- rustup component add --toolchain $VERSION clippy
- rustup component add --toolchain $VERSION rustfmt
cargo_cache:
folder: $HOME/.cargo/registry
clippy_script:
- . $HOME/.cargo/env
- cargo clippy --all-targets -- -D warnings
- cargo clippy --all-targets --all-features -- -D warnings
audit_script:
- . $HOME/.cargo/env
# install ca_root_nss due to https://github.com/rustsec/rustsec/issues/1137
- pkg install -y ca_root_nss cargo-audit
- cargo audit
minver_script:
- . $HOME/.cargo/env
- cargo update -Zdirect-minimal-versions
- cargo check --all-features --all-targets --all
before_cache_script: rm -rf $CARGO_HOME/registry/index

task:
name: Style
container:
image: rustlang/rust:nightly
cargo_cache:
folder: $HOME/.cargo/registry
fingerprint_script: cat Cargo.lock || echo ""
fmt_script:
- . $HOME/.cargo/env
- cargo fmt --all -- --check --color=never
before_cache_script: rm -rf $HOME/.cargo/registry/index
20 changes: 0 additions & 20 deletions .github/workflows/audit.yml

This file was deleted.

40 changes: 0 additions & 40 deletions .github/workflows/coverage.yml

This file was deleted.

29 changes: 0 additions & 29 deletions .github/workflows/docs.yml

This file was deleted.

29 changes: 0 additions & 29 deletions .github/workflows/release.yml

This file was deleted.

28 changes: 0 additions & 28 deletions .github/workflows/style.yml

This file was deleted.

34 changes: 0 additions & 34 deletions .github/workflows/test.yml

This file was deleted.

0 comments on commit 3b8b89c

Please sign in to comment.