Skip to content

CI

CI #9685

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
schedule:
- cron: "0 0 * * *"
env:
RUST_CACHE_KEY: rust-cache-20241114
# disable incremental builds in CI, it's not needed
CARGO_INCREMENTAL: 0
jobs:
sqlx:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: jdx/mise-action@v4
with:
version: 2026.9.17
install_args: --jobs=1 just fd cargo:sqlx-cli
- name: restore build & cargo cache
uses: Swatinem/rust-cache@v2
with:
prefix-key: ${{ env.RUST_CACHE_KEY }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Test database migrations
run: just test-database-migrations
- name: shut down test environment
if: ${{ always() }}
run: just compose-down-and-wipe
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: jdx/mise-action@v4
with:
version: 2026.9.17
install_args: --jobs=1 just cargo:cargo-nextest
- name: restore build & cargo cache
uses: Swatinem/rust-cache@v2
with:
prefix-key: ${{ env.RUST_CACHE_KEY }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: run tests
env:
# `pg_dump` in the gh action runner is too old for our postgres
# version, so we run it through `docker compose exec`.
DOCSRS_TEST_PG_DUMP_FROM_COMPOSE: "true"
run: just run-tests run-builder-tests
- name: shut down test environment
if: ${{ always() }}
run: just compose-down-and-wipe
GUI_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@v2.0.0
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: false
# all of these default to true, but feel free to set to
# "false" if our workflow needs parts
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Expose GitHub cache credentials
uses: crazy-max/ghaction-github-runtime@v4
- uses: jdx/mise-action@v4
with:
version: 2026.9.17
install_args: --jobs=1 just node cargo:sqlx-cli
- name: Run end-to-end GUI tests
env:
# run all necessary admin commands from the docker images, as
# we would in prod.
DOCSRS_CLI_MODE: docker
# run the preparation / builds for the e2e tests not
# on the gh action host, but inside our builder docker image.
# Like this we know this works.
DOCSRS_BUILDER_CLI_MODE: docker
run: just prepare-gui-tests run-gui-tests-e2e
- name: shut down test environment
if: ${{ always() }}
run: just compose-down-and-wipe
lint-format:
name: linters & formatters
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: jdx/mise-action@v4
with:
version: 2026.9.17
install_args: >-
--jobs=1 just actionlint deno fd cargo:cargo-machete
cargo:cargo-udeps cargo:cargo-sort typos
- name: restore build & cargo cache
uses: Swatinem/rust-cache@v2
with:
prefix-key: linters-${{ env.RUST_CACHE_KEY }}
- run: just format
- run: just lint
- run: just lint-dependencies-udeps