Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
larseggert committed Oct 10, 2024
1 parent 4db3ec7 commit 2a500d5
Showing 1 changed file with 38 additions and 18 deletions.
56 changes: 38 additions & 18 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,39 +25,59 @@ concurrency:
permissions:
contents: read

defaults:
run:
shell: bash

jobs:
toolchains:
runs-on: ubuntu-latest
outputs:
toolchains: ${{ steps.toolchains.outputs.toolchains }}
steps:
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
sparse-checkout: Cargo.toml
- id: toolchains
run: |
msrv="$(grep rust-version Cargo.toml | tr -d '"' | cut -f3 -d\ )"
echo "toolchains=[\"$msrv\", \"stable\", \"nightly\"]" >> "$GITHUB_OUTPUT"
check:
needs: toolchains
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
# Keep in sync with Cargo.toml
rust-toolchain: [1.76.0, stable, nightly]
toolchain: ${{ fromJSON(needs.toolchains.outputs.toolchains) }}
type: [debug]
include:
- os: ubuntu-latest
rust-toolchain: stable
toolchain: stable
type: release
- os: [ubuntu-latest, macos-latest]
rust-toolchain: nightly

- toolchain: nightly
type: debug
sanitizer: address
- toolchain: nightly
type: debug
sanitizer: thread
- toolchain: nightly
type: debug
sanitizer: [address thread leak]
sanitizer: leak

env:
BUILD_TYPE: ${{ matrix.type == 'release' && '--release' || '' }}
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash

steps:
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0

- uses: ./.github/actions/rust
with:
version: ${{ matrix.rust-toolchain }}
components: ${{ matrix.rust-toolchain == 'stable' && 'llvm-tools-preview' || matrix.rust-toolchain == 'nightly' && 'rust-src' || '' }}
tools: ${{ matrix.rust-toolchain == 'stable' && 'cargo-llvm-cov, ' || '' }} cargo-nextest
version: ${{ matrix.toolchain }}
components: ${{ matrix.toolchain == 'stable' && 'llvm-tools-preview' || matrix.toolchain == 'nightly' && 'rust-src' || '' }}
tools: ${{ matrix.toolchain == 'stable' && 'cargo-llvm-cov, ' || '' }} cargo-nextest
token: ${{ secrets.GITHUB_TOKEN }}

- id: nss-version
Expand All @@ -71,23 +91,23 @@ jobs:
if: matrix.sanitizer == null
run: |
# shellcheck disable=SC2086
cargo +${{ matrix.rust-toolchain }} check $BUILD_TYPE --all-targets --features ci
cargo +${{ matrix.toolchain }} check $BUILD_TYPE --all-targets --features ci
- name: Run tests and determine coverage
if: matrix.sanitizer == null
run: |
# shellcheck disable=SC2086
if [ "${{ matrix.rust-toolchain }}" == "stable" ]; then
RUST_LOG=trace cargo +${{ matrix.rust-toolchain }} llvm-cov nextest $BUILD_TYPE --features ci --no-fail-fast --lcov --output-path lcov.info
if [ "${{ matrix.toolchain }}" == "stable" ]; then
RUST_LOG=trace cargo +${{ matrix.toolchain }} llvm-cov nextest $BUILD_TYPE --features ci --no-fail-fast --lcov --output-path lcov.info
else
RUST_LOG=trace cargo +${{ matrix.rust-toolchain }} nextest run $BUILD_TYPE --features ci --no-fail-fast
RUST_LOG=trace cargo +${{ matrix.toolchain }} nextest run $BUILD_TYPE --features ci --no-fail-fast
fi
- name: Run client/server transfer
if: matrix.sanitizer == null
run: |
# shellcheck disable=SC2086
cargo +${{ matrix.rust-toolchain }} build $BUILD_TYPE --bin neqo-client --bin neqo-server
cargo +${{ matrix.toolchain }} build $BUILD_TYPE --bin neqo-client --bin neqo-server
"target/$BUILD_DIR/neqo-server" "$HOST:4433" &
PID=$!
# Give the server time to start.
Expand All @@ -109,7 +129,7 @@ jobs:
verbose: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
if: matrix.sanitizer == null && matrix.type == 'debug' && matrix.rust-toolchain == 'stable'
if: matrix.sanitizer == null && matrix.type == 'debug' && matrix.toolchain == 'stable'

- name: Run tests with sanitizers
if: matrix.sanitizer != null
Expand Down

0 comments on commit 2a500d5

Please sign in to comment.