Skip to content

CI

CI #142

Workflow file for this run

name: CI
on:
workflow_dispatch:
inputs:
test-all:
description: Run all test jobs
required: false
type: boolean
schedule:
- cron: 41 14 * * 3
pull_request:
push:
paths:
- 'ci/**'
- '**.rs'
- 'Cargo.toml'
defaults:
run:
shell: bash # for pipefail
env:
CARGO_TERM_COLOR: always
jobs:
test-stable:
name: Test on Rust stable
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write
steps:
- uses: actions/checkout@v4
# Runner's default (stable) rustc is fine
- uses: Swatinem/rust-cache@v2
- name: Install SARIF tools
run: cargo install clippy-sarif sarif-fmt
- name: Run lints (Clippy)
id: run-lint
run: cargo clippy --all-targets --all-features --message-format json |
clippy-sarif | tee clippy.sarif | sarif-fmt --color always
- uses: github/codeql-action/upload-sarif@v3
if: "!cancelled() && steps.run-lint.conclusion != 'skipped'"
with:
sarif_file: clippy.sarif
wait-for-processing: false
continue-on-error: true
- name: Run unit tests
if: "!cancelled() && steps.run-lint.conclusion != 'skipped'"
run: cargo test --all-features -- --color=always
- name: Run end-to-end tests
id: run-e2e
run: ci/test-e2e.sh
- name: Upload e2e-logs on failure
if: "!cancelled() && steps.run-e2e.conclusion == 'failure'"
uses: actions/upload-artifact@v4
with:
name: e2e-logs-stable
path: e2e-logs
continue-on-error: true
- name: Upload example binaries
uses: actions/upload-artifact@v4
with:
name: examples-bin
retention-days: 7
path: |
target/debug/examples/hello-cgi
continue-on-error: true
test-msrv:
name: Test on MSRV (1.66)
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- name: Setup Rust toolchain
run: rustup default 1.66
- uses: Swatinem/rust-cache@v2
- name: Lock dependencies for MSRV
run: |
cargo update -p tokio --precise 1.38.1
cargo update -p tokio-util --precise 0.7.11
- name: Run unit tests
run: cargo test --locked --all-features -- --color=always
- name: Run end-to-end tests
if: inputs.test-all || github.event_name == 'schedule'
id: run-e2e
run: ci/test-e2e.sh
- name: Upload e2e-logs on failure
if: "!cancelled() && steps.run-e2e.conclusion == 'failure'"
uses: actions/upload-artifact@v4
with:
name: e2e-logs-msrv
path: e2e-logs
continue-on-error: true
test-other:
if: inputs.test-all || github.event_name == 'schedule'
strategy:
matrix:
channel: [beta]
fail-fast: false
name: Test on Rust ${{ matrix.channel }}
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- name: Setup Rust toolchain
run: |-
rustup default ${{ matrix.channel }}
rustup component add clippy
- name: Run lints (Clippy)
id: run-lint
run: cargo clippy --all-targets --all-features
- name: Run unit tests
if: "!cancelled() && steps.run-lint.conclusion != 'skipped'"
run: cargo test --all-features -- --color=always
- name: Run end-to-end tests
id: run-e2e
run: ci/test-e2e.sh
- name: Upload e2e-logs on failure
if: "!cancelled() && steps.run-e2e.conclusion == 'failure'"
uses: actions/upload-artifact@v4
with:
name: e2e-logs-${{ matrix.channel }}
path: e2e-logs
continue-on-error: true