Skip to content

Commit

Permalink
ci: Adapt some initial CI (#1)
Browse files Browse the repository at this point in the history
This is mostly copied from upstream, with a bit of changes inspired by
our own usual CI setup.
  • Loading branch information
flub authored May 2, 2024
1 parent c0622eb commit a237a59
Showing 1 changed file with 15 additions and 32 deletions.
47 changes: 15 additions & 32 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,10 @@ name: CI

on:
push:
branches: ['main', '0.8.x']
branches: ['0.10.x']
pull_request:
schedule:
- cron: "21 3 * * 5"

jobs:
test-freebsd:
# see https://github.com/actions/runner/issues/385
# use https://github.com/vmactions/freebsd-vm for now
name: test on freebsd
runs-on: macos-12
steps:
- uses: actions/checkout@v3
- name: test on freebsd
uses: vmactions/freebsd-vm@v0
with:
usesh: true
mem: 4096
copyback: false
prepare: |
pkg install -y curl
curl https://sh.rustup.rs -sSf --output rustup.sh
sh rustup.sh -y --profile minimal --default-toolchain stable
echo "~~~~ rustc --version ~~~~"
$HOME/.cargo/bin/rustc --version
echo "~~~~ freebsd-version ~~~~"
freebsd-version
run: $HOME/.cargo/bin/cargo build --all-targets && $HOME/.cargo/bin/cargo test && $HOME/.cargo/bin/cargo test --manifest-path fuzz/Cargo.toml
test:
strategy:
matrix:
Expand All @@ -43,38 +19,45 @@ jobs:

runs-on: ${{ matrix.os }}

env:
RUSTC_WRAPPER: "sccache"
SCCACHE_GHA_ENABLED: "on"

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: mozilla-actions/[email protected]
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
- uses: Swatinem/rust-cache@v1
- run: cargo build --all-targets
- run: cargo test
- run: cargo test --manifest-path fuzz/Cargo.toml
if: ${{ matrix.rust }} == "stable"

msrv:
runs-on: ubuntu-latest
env:
RUSTC_WRAPPER: "sccache"
SCCACHE_GHA_ENABLED: "on"
steps:
- uses: actions/checkout@v3
- uses: mozilla-actions/[email protected]
- uses: dtolnay/[email protected]
- uses: Swatinem/rust-cache@v1
- run: cargo check --lib --all-features -p quinn-udp -p quinn-proto -p quinn

lint:
runs-on: ubuntu-latest
env:
RUSTC_WRAPPER: "sccache"
SCCACHE_GHA_ENABLED: "on"
steps:
- uses: actions/checkout@v3
- uses: mozilla-actions/[email protected]
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v1
- run: cargo fmt --all -- --check
- run: cargo clippy --all-targets -- -D warnings
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- name: doc
run: cargo doc --no-deps --document-private-items
env:
Expand Down

0 comments on commit a237a59

Please sign in to comment.