name: CI
on:
pull_request:
push:
branches:
- main
jobs:
test:
name: Build
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macOS-latest, ubuntu-latest, windows-latest]
rust: [nightly, stable]
steps:
- name: get-cmake
uses: lukka/get-cmake@v4.3.1
- name: Install NASM for aws-lc-rs on Windows
if: runner.os == 'Windows'
uses: ilammy/setup-nasm@v1
- uses: actions/checkout@master
- name: Install ${{ matrix.rust }}
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
override: true
- uses: actions/cache@v5
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
- name: Use lld on macOS
if: runner.os == 'macOS'
run: |
brew install lld
echo "RUSTFLAGS=-Clink-arg=-fuse-ld=$(brew --prefix lld)/bin/ld64.lld" >> "$GITHUB_ENV"
- name: Build (non-Windows)
if: runner.os != 'Windows'
uses: actions-rs/cargo@v1
with:
command: build
args: --all-features
- name: Build (Windows, no openssl)
if: runner.os == 'Windows'
uses: actions-rs/cargo@v1
with:
command: build
args: --no-default-features --features serve,dev-server,client,bench,proxy,grpc,native-tls,rustls,h3
feature-matrix:
name: Feature powerset
runs-on: ubuntu-latest
env:
RUSTFLAGS: -Dwarnings
steps:
- uses: actions/checkout@master
- uses: dtolnay/rust-toolchain@stable
- uses: taiki-e/install-action@cargo-hack
- uses: Swatinem/rust-cache@v2.9.1
- name: cargo hack check --feature-powerset
run:
cargo hack check
--feature-powerset --depth 3
--exclude-features dev-server,grpc
--at-least-one-of serve,client,bench,proxy
--keep-going
check_fmt_and_docs:
name: Lints and Docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: clippy
override: true
- name: Install nightly rustfmt
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
components: rustfmt
- uses: giraffate/clippy-action@v1
with:
reporter: 'github-pr-review'
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Format
run: cargo +nightly fmt -- --check