Skip to content

fix: return (String, usize) on non-supported platforms #130

fix: return (String, usize) on non-supported platforms

fix: return (String, usize) on non-supported platforms #130

Workflow file for this run

name: Check
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
merge_group:
schedule:
- cron: "26 3 * * *" # 03:26 UTC
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true
permissions:
contents: read
jobs:
check:
name: Check
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
# Keep low end in sync with Cargo.toml
rust-toolchain: [1.76.0, stable, nightly]
type: [debug]
include:
- os: ubuntu-latest
rust-toolchain: stable
type: release
- os: macos-latest
rust-toolchain: stable
type: release
- os: windows-latest
rust-toolchain: stable
type: release
- os: ubuntu-20.04
rust-toolchain: stable
type: debug
- os: macos-12
rust-toolchain: stable
type: debug
- os: windows-2019
rust-toolchain: stable
type: debug
env:
BUILD_TYPE: ${{ matrix.type == 'release' && '--release' || '' }}
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Get "Install Rust" action from neqo
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
repository: mozilla/neqo
sparse-checkout: |
.github/actions/rust
path: neqo
- name: Install Rust
uses: ./neqo/.github/actions/rust
with:
version: ${{ matrix.rust-toolchain }}
components: rustfmt, clippy, llvm-tools-preview, ${{ matrix.rust-toolchain == 'nightly' && 'rust-src' || '' }}
tools: cargo-llvm-cov, cargo-nextest, cargo-hack, cargo-machete, ${{ matrix.rust-toolchain == 'stable' && 'cargo-semver-checks' || '' }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Build
run: |
# shellcheck disable=SC2086
cargo +${{ matrix.rust-toolchain }} build $BUILD_TYPE --all-targets
- name: Run tests and determine coverage
run: |
# shellcheck disable=SC2086
RUST_LOG=trace cargo +${{ matrix.rust-toolchain }} llvm-cov nextest $BUILD_TYPE --no-fail-fast --lcov --output-path lcov.info
cargo +${{ matrix.rust-toolchain }} bench --no-run
- name: Run tests with sanitizers
if: (matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest') && matrix.rust-toolchain == 'nightly'
run: |
if [ "${{ matrix.os }}" = "ubuntu-latest" ]; then
TARGET="x86_64-unknown-linux-gnu"
SANITIZERS="address thread leak memory"
elif [ "${{ matrix.os }}" = "macos-latest" ]; then
TARGET="aarch64-apple-darwin"
# no memory and leak sanitizer support yet
SANITIZERS="address thread"
fi
for sanitizer in $SANITIZERS; do
echo "Running tests with $sanitizer sanitizer..."
RUSTFLAGS="-Z sanitizer=$sanitizer" RUSTDOCFLAGS="-Z sanitizer=$sanitizer" cargo +nightly test -Z build-std --target "$TARGET"
done
- name: Check formatting
run: |
if [ "${{ matrix.rust-toolchain }}" != "nightly" ]; then
CONFIG_PATH="--config-path=$(mktemp)"
fi
# shellcheck disable=SC2086
cargo +${{ matrix.rust-toolchain }} fmt --all -- --check $CONFIG_PATH
if: success() || failure()
- name: Check for unused dependencies
run: |
# --with-metadata has false positives, see https://github.com/bnjbvr/cargo-machete/issues/127
cargo +${{ matrix.rust-toolchain }} machete
- name: Clippy
run: |
cargo +${{ matrix.rust-toolchain }} hack clippy --all-targets --feature-powerset -- -D warnings || ${{ matrix.rust-toolchain == 'nightly' }}
if: success() || failure()
- name: Check rustdoc links
run: cargo +${{ matrix.rust-toolchain }} doc --workspace --no-deps --document-private-items
env:
RUSTDOCFLAGS: "--deny rustdoc::broken_intra_doc_links --deny warnings"
if: success() || failure()
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0
with:
file: lcov.info
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
if: matrix.type == 'debug' && matrix.rust-toolchain == 'stable' && endsWith(matrix.os, '-latest')
- name: cargo-semver-checks
if: matrix.rust-toolchain == 'stable'
run: cargo semver-checks
check-freebsd:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Get "Install Rust" action from neqo
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
repository: mozilla/neqo
sparse-checkout: |
.github/actions/rust
path: neqo
- name: Install Rust
uses: ./neqo/.github/actions/rust
- run: rustup target add x86_64-unknown-freebsd
- run: cargo check --target x86_64-unknown-freebsd