Skip to content

ci: Use vmactions for checks on other platforms #32

ci: Use vmactions for checks on other platforms

ci: Use vmactions for checks on other platforms #32

Workflow file for this run

name: CI VM
on:
push:
branches: ["main"]
paths-ignore: ["*.md", "*.png", "*.svg", "LICENSE-*"]
pull_request:
branches: ["main"]
paths-ignore: ["*.md", "*.png", "*.svg", "LICENSE-*"]
merge_group:
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true
permissions:
contents: read
jobs:
check-vm:
strategy:
fail-fast: false
matrix:
os: [freebsd, openbsd, netbsd] # solaris has a super-old rust package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- run: curl -o rustup.sh --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs
- if: matrix.os == 'freebsd'
uses: vmactions/freebsd-vm@debf37ca7b7fa40e19c542ef7ba30d6054a706a4
with:
usesh: true
envs: "CARGO_TERM_COLOR RUST_BACKTRACE GITHUB_ACTIONS"
prepare: |
pkg install -y curl llvm nss pkgconf
run: |
sh rustup.sh --default-toolchain stable --component llvm-tools -y
. "$HOME/.cargo/env"
# export RUST_LOG=trace
cargo install cargo-llvm-cov --locked
cargo check --all-targets
cargo clippy
cargo llvm-cov test --features ci --no-fail-fast --lcov --output-path lcov.info
cargo test --features ci --no-fail-fast --release
- if: matrix.os == 'openbsd'
uses: vmactions/openbsd-vm@0cfe06e734a0ea3a546fca7ebf200b984b94d58a
with:
usesh: true
envs: "CARGO_TERM_COLOR RUST_BACKTRACE GITHUB_ACTIONS"
prepare: |
pkg_add rust llvm-16.0.6p30 nss pkgconf # rustup doesn't support OpenBSD at all
run: |
export LIBCLANG_PATH=/usr/local/llvm16/lib
# export RUST_LOG=trace
cargo check --all-targets
# FIXME: unsupported: cargo clippy
# FIXME: Next line should run llvm-cov, but it's not available on OpenBSD:
cargo test --features ci --no-fail-fast
cargo test --features ci --no-fail-fast --release
- if: matrix.os == 'netbsd'
uses: vmactions/netbsd-vm@7c9086fdb4cc1aa814cda6e305390c2b966551a9
with:
usesh: true
envs: "CARGO_TERM_COLOR RUST_BACKTRACE GITHUB_ACTIONS"
prepare: |
/usr/sbin/pkg_add pkgin
pkgin -y install curl clang nss pkgconf
run: |
sh rustup.sh --default-toolchain stable --component llvm-tools -y
. "$HOME/.cargo/env"
export LIBCLANG_PATH=/usr/pkg/lib
# export RUST_LOG=trace
cargo install cargo-llvm-cov --locked
cargo check --all-targets
cargo clippy
# FIXME: error[E0463]: can't find crate for `profiler_builtins`,
# so don't fail the workflow when that happens.
cargo llvm-cov test --features ci --no-fail-fast --lcov --output-path lcov.info || true
cargo test --features ci --no-fail-fast --release
- if: matrix.os == 'solaris'
uses: vmactions/solaris-vm@a89b9438868c70db27e41625f0a5de6ff5e90809
with:
release: "11.4-gcc"
usesh: true
envs: "CARGO_TERM_COLOR RUST_BACKTRACE GITHUB_ACTIONS"
prepare: |
pkg install cargo nss pkg-config
run: |
sh rustup.sh --default-toolchain stable --component llvm-tools -y
. "$HOME/.cargo/env"
# export RUST_LOG=trace
cargo check --all-targets --features ci
# FIXME: This should run llvm-cov:
cargo test --features ci --no-fail-fast
cargo test --features ci --no-fail-fast --release
- uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0
with:
file: lcov.info
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}