Skip to content

Squash & Approve

Squash & Approve #2555

Workflow file for this run

name: Test
on:
pull_request: { }
merge_group: { }
# We only run this on push to main to prime CI cache
push:
branches:
- main
permissions:
contents: read
jobs:
test:
name: Test
runs-on: ubuntu-latest
env:
# Matches docker-compose.yaml
DATABASE_URL: postgres://bors:bors@localhost:5432/bors
steps:
- name: Checkout sources
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Start containers
run: docker compose up -d --wait
- name: Install stable toolchain
uses: actions-rust-lang/setup-rust-toolchain@166cdcfd11aee3cb47222f9ddb555ce30ddb9659 # v1.17.0
with:
toolchain: 1.88.0
components: clippy, rustfmt
- name: Install sqlx-cli
run: cargo install sqlx-cli@0.7.4 --locked --no-default-features --features native-tls,postgres
- name: Run SQLx migrations
run: cargo sqlx database create && sqlx migrate run
- name: Check .sqlx files
run: cargo sqlx prepare --check -- --all-targets
- name: Build
run: cargo build --workspace --all-targets --locked
- name: Test
run: cargo test --workspace
- name: Lint code
run: cargo clippy --workspace --all-targets
- name: Check formatting
run: cargo fmt --all --check
docker:
name: Test Docker
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: docker/setup-buildx-action@37fe631027851001ddb9b187196cc803df7f5f0e # v4.3.0
- name: Build the Docker image
uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7.3.0
with:
context: .
cache-from: type=gha
cache-to: type=gha,mode=max
tags: bors
load: true
- name: Run Docker image
run: docker run bors --help