name: CI
on:
push:
branches: ["**"]
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
jobs:
ci:
name: Check, Test, Lint
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v7
- name: Rust toolchain (rust-toolchain.toml)
run: rustup toolchain install
- uses: Swatinem/rust-cache@v2
- name: cargo fmt
run: |
cargo fmt --all --check
cargo fmt --all --check --manifest-path fuzz/Cargo.toml
- name: cargo check
run: cargo check --locked
- name: Install multiplexers
run: sh scripts/install-multiplexers.sh
- name: cargo test
run: cargo test --locked
- name: cargo clippy
run: cargo clippy --locked -- -D warnings
- uses: taiki-e/install-action@cargo-deny
- name: cargo deny (advisories, bans, licenses, sources)
run: cargo deny check
- name: cargo doc (broken intra-doc links fail)
run: cargo doc --locked --no-deps
env:
RUSTDOCFLAGS: -D warnings
- uses: taiki-e/install-action@cargo-machete
- name: cargo machete (a dependency nothing uses fails)
run: cargo machete
msrv:
name: MSRV (rust-version in Cargo.toml)
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v7
- name: rust-version from Cargo.toml
id: msrv
run: echo "version=$(sed -nE 's/^rust-version = "([^"]+)".*/\1/p' Cargo.toml)" >> "$GITHUB_OUTPUT"
- name: install the MSRV toolchain
run: rustup toolchain install "${{ steps.msrv.outputs.version }}" --profile minimal
- uses: Swatinem/rust-cache@v2
- name: cargo check on the MSRV
run: cargo "+${{ steps.msrv.outputs.version }}" check --locked
provisioners:
name: Provisioner tests (Postgres)
runs-on: ubuntu-latest
timeout-minutes: 40
services:
postgres:
image: postgres:16
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports: ["5432:5432"]
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
mysql:
image: mysql:8
env:
MYSQL_ROOT_PASSWORD: root
ports: ["3306:3306"]
options: >-
--health-cmd "mysqladmin ping -h 127.0.0.1 -uroot -proot"
--health-interval 10s
--health-timeout 5s
--health-retries 10
env:
PGHOST: localhost
PGUSER: postgres
PGPASSWORD: postgres
MYSQL_HOST: 127.0.0.1
MYSQL_TCP_PORT: "3306"
MYSQL_USER: root
MYSQL_PWD: root
steps:
- uses: actions/checkout@v7
- name: Rust toolchain (rust-toolchain.toml)
run: rustup toolchain install
- uses: Swatinem/rust-cache@v2
- name: install db clients (createdb/dropdb, mysqladmin)
run: sudo apt-get update && sudo apt-get install -y postgresql-client default-mysql-client
- name: runtime versions from mise.toml
id: pin
run: |
for tool in ruby node php dotnet erlang elixir; do
echo "$tool=$(sed -nE "s/^$tool = \"([^\"]+)\".*/\1/p" mise.toml)" >> "$GITHUB_OUTPUT"
done
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ steps.pin.outputs.ruby }}
- name: install the Rails fixture's gems (so the cycle test runs)
working-directory: tests/fixtures/rails
run: bundle install --jobs 4
- uses: actions/setup-node@v7
with:
node-version: ${{ steps.pin.outputs.node }}
- name: install the Prisma fixture's deps (so the cycle test runs)
working-directory: tests/fixtures/prisma
run: npm install --no-audit --no-fund
- name: set up the Alembic fixture's venv (so the cycle test runs)
working-directory: tests/fixtures/alembic
run: python3 -m venv .venv && ./.venv/bin/pip install -q -r requirements.txt
- name: set up the Django fixture's venv (so the cycle test runs)
working-directory: tests/fixtures/django
run: python3 -m venv .venv && ./.venv/bin/pip install -q -r requirements.txt
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ steps.pin.outputs.php }}
- name: set up the Laravel fixture (so the cycle test runs)
working-directory: tests/fixtures/laravel
run: composer install --no-interaction --quiet && cp .env.example .env && php artisan key:generate --force
- uses: actions/setup-dotnet@v6
with:
dotnet-version: ${{ steps.pin.outputs.dotnet }}.x
- name: restore the EF Core fixture (so the cycle test runs)
working-directory: tests/fixtures/efcore
run: dotnet restore && dotnet tool restore
- uses: erlef/setup-beam@v1
with:
otp-version: ${{ steps.pin.outputs.erlang }}
elixir-version: ${{ steps.pin.outputs.elixir }}
- name: set up the Phoenix fixture's deps (so the cycle test runs)
working-directory: tests/fixtures/phoenix
run: mix local.hex --force && mix deps.get && mix compile
- name: Install multiplexers
run: sh scripts/install-multiplexers.sh
- name: cargo test (DB-gated cycles run here)
run: cargo test --locked