Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Use vmactions for checks on other platforms #2133

Merged
merged 41 commits into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
5585319
ci: Use `vmactions` for checks on other platforms
larseggert Sep 24, 2024
769cf46
More
larseggert Sep 24, 2024
08b7641
More
larseggert Sep 24, 2024
e406876
More
larseggert Sep 24, 2024
fb6e0ec
NSS
larseggert Sep 24, 2024
e1f06ac
More NSS
larseggert Sep 24, 2024
2f557c8
More NSS
larseggert Sep 24, 2024
74edfb6
More NSS
larseggert Sep 24, 2024
d4c574d
bash
larseggert Sep 24, 2024
f3942fe
More bash
larseggert Sep 24, 2024
70b419e
More
larseggert Sep 24, 2024
da94f0d
Solaris release
larseggert Sep 24, 2024
e3ec66a
More
larseggert Sep 24, 2024
0e144a7
python
larseggert Sep 24, 2024
491c5b8
Again
larseggert Sep 24, 2024
4b8441a
Again
larseggert Sep 24, 2024
aa183c0
Again
larseggert Sep 24, 2024
3e60161
Again
larseggert Sep 24, 2024
f218618
Again
larseggert Sep 24, 2024
64cffbb
--break-system-packages
larseggert Sep 24, 2024
7d6be83
gmake
larseggert Sep 24, 2024
a9f89bd
NSS from packages
larseggert Sep 25, 2024
b2f3229
More
larseggert Sep 25, 2024
e89c582
Merge branch 'main' into ci-vmactions
larseggert Oct 3, 2024
92055ee
Don't even try solaris
larseggert Oct 3, 2024
6a9b54d
Merge branch 'main' into ci-vmactions
larseggert Nov 15, 2024
207c59c
From `mtu`
larseggert Nov 15, 2024
13b82a8
rustup
larseggert Nov 15, 2024
8c6d593
nss & ci
larseggert Nov 15, 2024
771f1d8
no trace
larseggert Nov 15, 2024
5a4855d
Only test in CI on Linux
larseggert Nov 18, 2024
3029b18
Merge branch 'main' into ci-vmactions
larseggert Dec 2, 2024
b8b31c3
From mozilla/mtu
larseggert Dec 2, 2024
981ce3e
nss
larseggert Dec 2, 2024
abd6d81
Fix test condition
larseggert Dec 2, 2024
5bb3f14
Don't sync `target` back to host
larseggert Dec 2, 2024
6c34bd4
Merge branch 'main' into ci-vmactions
larseggert Jan 10, 2025
1cb8951
Check NSS version
larseggert Jan 10, 2025
c2fc1f1
Fix
larseggert Jan 10, 2025
19ff4a1
Check NSS version on all OSs
larseggert Jan 10, 2025
a8d7e8c
`LD_LIBRARY_PATH` on NetBSD
larseggert Jan 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
167 changes: 167 additions & 0 deletions .github/workflows/check-vm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
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
RUST_LOG: trace

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]
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- id: nss-version
run: echo "minimum=$(cat neqo-crypto/min_version.txt)" >> "$GITHUB_OUTPUT"

- 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 RUST_LOG GITHUB_ACTIONS"
prepare: | # This executes as root
set -e
pkg install -y curl llvm nss pkgconf
run: | # This executes as user
set -e
# FIXME: We're only comparing the NSS minor version here.
NSS_MINOR_VERSION="$(pkg-config --modversion nss | cut -d. -f2)"
NSS_MINIMUM_VERSION="$(echo ${{ steps.nss-version.outputs.minimum }} | cut -d. -f2)"
if [ "$NSS_MINOR_VERSION" -lt "$NSS_MINIMUM_VERSION" ]; then
echo "System NSS package too old (minorversion $NSS_MINOR_VERSION < $NSS_MINIMUM_VERSION); skipping checks"
exit 0
fi
sh rustup.sh --default-toolchain stable --profile minimal --component clippy llvm-tools -y
. "$HOME/.cargo/env"
cargo check --all-targets
cargo clippy -- -D warnings
cargo install cargo-llvm-cov --locked
cargo llvm-cov test --no-fail-fast --lcov --output-path lcov.info
cargo test --no-fail-fast --release
rm -rf target # Don't sync this back to host

- if: matrix.os == 'openbsd'
uses: vmactions/openbsd-vm@0cfe06e734a0ea3a546fca7ebf200b984b94d58a
with:
usesh: true
envs: "CARGO_TERM_COLOR RUST_BACKTRACE RUST_LOG GITHUB_ACTIONS"
prepare: | # This executes as root
set -e
pkg_add rust rust-clippy llvm-16.0.6p30 nss pkgconf # rustup doesn't support OpenBSD at all
run: | # This executes as user
set -e
# FIXME: We're only comparing the NSS minor version here.
NSS_MINOR_VERSION="$(pkg-config --modversion nss | cut -d. -f2)"
NSS_MINIMUM_VERSION="$(echo ${{ steps.nss-version.outputs.minimum }} | cut -d. -f2)"
if [ "$NSS_MINOR_VERSION" -lt "$NSS_MINIMUM_VERSION" ]; then
echo "System NSS package too old (minorversion $NSS_MINOR_VERSION < $NSS_MINIMUM_VERSION); skipping checks"
exit 0
fi
export LIBCLANG_PATH=/usr/local/llvm16/lib
cargo check --all-targets
cargo clippy -- -D warnings
# FIXME: No profiler support in openbsd currently, error is:
# > error[E0463]: can't find crate for `profiler_builtins`
# > = note: the compiler may have been built without the profiler runtime
# export LLVM_COV=/usr/local/llvm16/bin/llvm-cov
# export LLVM_PROFDATA=/usr/local/llvm16/bin/llvm-profdata
# cargo install cargo-llvm-cov --locked
# cargo llvm-cov test --no-fail-fast --lcov --output-path lcov.info
cargo test --no-fail-fast # Remove this once profiler is supported
cargo test --no-fail-fast --release
rm -rf target # Don't sync this back to host

- if: matrix.os == 'netbsd'
uses: vmactions/netbsd-vm@7c9086fdb4cc1aa814cda6e305390c2b966551a9
with:
usesh: true
envs: "CARGO_TERM_COLOR RUST_BACKTRACE RUST_LOG GITHUB_ACTIONS"
prepare: | # This executes as root
set -e
/usr/sbin/pkg_add pkgin
pkgin -y install curl clang nss pkgconf
run: | # This executes as user
set -e
# FIXME: We're only comparing the NSS minor version here.
NSS_MINOR_VERSION="$(pkg-config --modversion nss | cut -d. -f2)"
NSS_MINIMUM_VERSION="$(echo ${{ steps.nss-version.outputs.minimum }} | cut -d. -f2)"
if [ "$NSS_MINOR_VERSION" -lt "$NSS_MINIMUM_VERSION" ]; then
echo "System NSS package too old (minorversion $NSS_MINOR_VERSION < $NSS_MINIMUM_VERSION); skipping checks"
exit 0
fi
sh rustup.sh --default-toolchain stable --profile minimal --component clippy llvm-tools -y
. "$HOME/.cargo/env"
# FIXME: Why do we need to set this on NetBSD?
export LD_LIBRARY_PATH=/usr/pkg/lib/nss:/usr/pkg/lib/nspr
cargo check --all-targets
cargo clippy -- -D warnings
# FIXME: No profiler support in netbsd currently, error is:
# > error[E0463]: can't find crate for `profiler_builtins`
# > = note: the compiler may have been built without the profiler runtime
# cargo install cargo-llvm-cov --locked
# cargo llvm-cov test --no-fail-fast --lcov --output-path lcov.info
cargo test --no-fail-fast # Remove this once profiler is supported
cargo test --no-fail-fast --release
rm -rf target # Don't sync this back to host

- if: matrix.os == 'solaris'
uses: vmactions/solaris-vm@a89b9438868c70db27e41625f0a5de6ff5e90809
with:
release: "11.4-gcc"
usesh: true
envs: "CARGO_TERM_COLOR RUST_BACKTRACE RUST_LOG GITHUB_ACTIONS"
prepare: | # This executes as root
set -e
pkg install clang-libs nss pkg-config
run: | # This executes as also as root on Solaris
set -e
# FIXME: We're only comparing the NSS minor version here.
NSS_MINOR_VERSION="$(pkg-config --modversion nss | cut -d. -f2)"
NSS_MINIMUM_VERSION="$(echo ${{ steps.nss-version.outputs.minimum }} | cut -d. -f2)"
if [ "$NSS_MINOR_VERSION" -lt "$NSS_MINIMUM_VERSION" ]; then
echo "System NSS package too old (minorversion $NSS_MINOR_VERSION < $NSS_MINIMUM_VERSION); skipping checks"
exit 0
fi
source <(curl -s https://raw.githubusercontent.com/psumbera/solaris-rust/refs/heads/main/sh.rust-web-install) || true # This doesn't exit with zero on success
export LIBCLANG_PATH="/usr/lib/amd64"
cargo check --all-targets
cargo clippy -- -D warnings
# FIXME: No profiler support in openbsd currently, error is:
# > error[E0463]: can't find crate for `profiler_builtins`
# > = note: the compiler may have been built without the profiler runtime
# cargo install cargo-llvm-cov --locked
# cargo llvm-cov test --no-fail-fast --lcov --output-path lcov.info
cargo test --no-fail-fast # Remove this once profiler is supported
cargo test --no-fail-fast --release
rm -rf target # Don't sync this back to host

- uses: codecov/codecov-action@015f24e6818733317a2da2edd6290ab26238649a # v5.0.7
with:
files: lcov.info
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
11 changes: 3 additions & 8 deletions neqo-common/src/hrtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -370,14 +370,9 @@ impl Drop for Time {
}
}

// Only run these tests in CI on platforms other than MacOS and Windows, where the timer
// inaccuracies are too high to pass the tests.
#[cfg(all(
test,
not(all(any(target_os = "macos", target_os = "windows"), feature = "ci")),
// Sanitizers are too slow to uphold timing assumptions.
not(neqo_sanitize),
))]
// Only run these tests in CI on Linux, where the timer accuracies are OK enough to pass the tests,
// but only when not running sanitizers.
#[cfg(all(test, target_os = "linux", not(neqo_sanitize)))]
mod test {
use std::{
thread::{sleep, spawn},
Expand Down
Loading