Skip to content

Update funding

Update funding #836

Workflow file for this run

on: [push, pull_request]
name: Continuous integration
env:
CI: 1
CARGO_INCREMENTAL: 0
CARGO_NET_RETRY: 10
RUSTUP_MAX_RETRIES: 10
RUSTFLAGS: "-D warnings -W bare-trait-objects"
NIGHTLY_VERSION: "nightly-2023-02-09"
ZIG_VERSION: "0.11.0"
jobs:
all:
name: Build on ${{ matrix.os }}, ${{ matrix.target }} (audit=${{ matrix.audit || 'false' }}, rustfmt=${{ matrix.rustfmt || 'false' }}, no_build_tests=${{ matrix.no_build_tests || 'false' }}, no_run_tests=${{ matrix.no_run_tests || 'false' }}, no_release_build=${{ matrix.no_release_build || 'false' }}, zigbuild=${{ matrix.zigbuild || 'false' }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
# GNU/Linux
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
audit: true
rustfmt: true
- os: ubuntu-latest
target: x86_64-unknown-linux-musl
- os: ubuntu-latest
target: i686-unknown-linux-gnu
zigbuild: true
- os: ubuntu-latest
target: riscv64gc-unknown-linux-gnu
no_build_tests: true # NOTE: Relocations in generic ELF (EM: 243)
no_release_build: true # NOTE: Relocations in generic ELF (EM: 243)
zigbuild: true # NOTE: tests linking fail with "error: unknown directive .cfi_label .Ldummy"
# - os: ubuntu-latest
# target: i686-unknown-linux-musl # NOTE: target 'i686-unknown-linux-musl' not found in channel
- os: ubuntu-latest
target: aarch64-unknown-linux-gnu # NOTE: Relocations in generic ELF (EM: 183)
zigbuild: true
- os: ubuntu-latest
target: aarch64-unknown-linux-musl # NOTE: Relocations in generic ELF (EM: 183)
zigbuild: true
# - os: ubuntu-latest
# target: riscv64gc-unknown-linux-musl # NOTE: toolchain ... does not contain component 'rust-std' for target
# macOS
- os: macos-latest
target: x86_64-apple-darwin
- os: macos-latest
target: aarch64-apple-darwin
no_run_tests: true # NOTE: Bad CPU type in executable (os error 86)
# Windows
- os: windows-latest
target: x86_64-pc-windows-gnu
- os: windows-latest
target: x86_64-pc-windows-msvc
- os: windows-latest
target: i686-pc-windows-msvc
- os: windows-latest
target: i686-pc-windows-gnu
zigbuild: true
- os: windows-latest
target: aarch64-pc-windows-msvc
no_build_tests: true # NOTE: could not execute process
#zigbuild: true # NOTE: tests linking fails with "zig.exe: InvalidUtf8 error: UnableToSpawnSelf"
# - os: windows-latest
# target: aarch64-pc-windows-gnullvm # NOTE: can't find crate for `core`
# FreeBSD
- os: ubuntu-latest
target: x86_64-unknown-freebsd
no_build_tests: true # NOTE: ld: cannot find -lexecinfo: No such file or directory
no_release_build: true # NOTE: ld: cannot find -lexecinfo: No such file or directory
#zigbuild: true # NOTE: tests linking fails "unsupported target 'x86_64-unknown-freebsd'"
# - os: ubuntu-latest
# target: i686-unknown-freebsd # NOTE: target 'i686-unknown-freebsd' not found in channel
# - os: ubuntu-latest
# target: aarch64-unknown-freebsd # NOTE: toolchain ... does not contain component 'rust-std' for target
# - os: ubuntu-latest
# target: riscv64gc-unknown-freebsd # NOTE: toolchain ... does not contain component 'rust-std' for target
# NetBSD
- os: ubuntu-latest
target: x86_64-unknown-netbsd
no_build_tests: true # NOTE: ld: cannot find -lexecinfo: No such file or directory
no_release_build: true # NOTE: ld: cannot find -lexecinfo: No such file or directory
#zigbuild: true # NOTE: tests linking fails "Error: unsupported target 'x86_64-unknown-netbsd'"
# - os: ubuntu-latest
# target: i686-unknown-netbsd # NOTE: toolchain ... does not contain component 'rust-std' for target
# - os: ubuntu-latest
# target: aarch64-unknown-netbsd # NOTE: toolchain ... does not contain component 'rust-std' for target
# - os: ubuntu-latest
# target: aarch64_be-unknown-netbsd # NOTE: toolchain ... does not contain component 'rust-std' for target
# - os: ubuntu-latest
# target: riscv64gc-unknown-netbsd # NOTE: toolchain ... does not contain component 'rust-std' for target
# OpenBSD
# - os: ubuntu-latest
# target: x86_64-unknown-openbsd # NOTE: toolchain ... does not contain component 'rust-std' for target
# - os: ubuntu-latest
# target: i686-unknown-openbsd # NOTE: toolchain ... does not contain component 'rust-std' for target
# - os: ubuntu-latest
# target: aarch64-unknown-openbsd # NOTE: toolchain ... does not contain component 'rust-std' for target
# - os: ubuntu-latest
# target: riscv64gc-unknown-openbsd # NOTE: toolchain ... does not contain component 'rust-std' for target
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust toolchain
run: |
rustup update --no-self-update
rustup target add ${{ matrix.target }}
rustup install --force-non-host $(cat rust-toolchain)-${{ matrix.target }}
rustup default $(cat rust-toolchain)-${{ matrix.target }}
rustup component add clippy rust-src
- name: Install Nightly and Rustfmt
if: ${{ matrix.rustfmt }}
run: |
rustup install "${NIGHTLY_VERSION}"
rustup component add --toolchain "${NIGHTLY_VERSION}" rustfmt
- name: Install Zig
if: ${{ matrix.zigbuild }}
uses: korandoru/setup-zig@v1
with:
zig-version: ${{ env.ZIG_VERSION }}
- run: zig version
if: ${{ matrix.zigbuild }}
- name: Install Zigbuild
if: ${{ matrix.zigbuild }}
run: cargo install --locked cargo-zigbuild
- name: Check vulnerabilities with existing patches
if: ${{ matrix.audit }}
run: |
ISSUES_WITHOUT_PATCHES=($(cargo audit --json | jq --raw-output '.vulnerabilities.list[] | select(.versions.patched | length == 0) | .advisory.id' | sed 's!^! --ignore !' | tr -d '\n'))
cargo audit ${ISSUES_WITHOUT_PATCHES[@]}
- name: Rustfmt
if: ${{ matrix.rustfmt }}
run: cargo "+${NIGHTLY_VERSION}" fmt --all -- --check
- name: Check
run: cargo check --locked --verbose --all-features --target=${{ matrix.target }}
- name: Clippy
run: cargo clippy -- -D warnings -D clippy::dbg_macro -D clippy::print_stderr -D clippy::print_stdout
- name: Build Tests
if: ${{ !matrix.no_build_tests && !matrix.zigbuild }}
run: cargo test --no-run --locked --verbose --all-features --target=${{ matrix.target }}
- name: Zigbuild Tests
if: ${{ !matrix.no_build_tests && matrix.zigbuild }}
run: cargo zigbuild --tests --locked --verbose --all-features --target=${{ matrix.target }}
- name: Run Tests
if: ${{ !matrix.no_build_tests && !matrix.no_run_tests && !matrix.zigbuild }}
run: cargo test --locked --verbose --all-features --target=${{ matrix.target }}
- name: Build Release
if: ${{ !matrix.no_release_build && !matrix.zigbuild }}
run: cargo build --locked --verbose --all-features --release --target=${{ matrix.target }}
- name: Zigbuild Release
if: ${{ !matrix.no_release_build && matrix.zigbuild }}
run: cargo zigbuild --locked --verbose --all-features --release --target=${{ matrix.target }}