workon 0.24.3

Development workspace launcher with Zellij, Claude CLI, and branchdiff
Documentation
name: CI

on:
  push:
    branches: ["**"]
  pull_request:

env:
  CARGO_TERM_COLOR: always

jobs:
  ci:
    name: Check, Test, Lint
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5

      - uses: dtolnay/rust-toolchain@stable
        with:
          components: clippy

      - uses: Swatinem/rust-cache@v2

      - name: cargo check
        run: cargo check --locked

      - 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 check licenses
        run: cargo deny check licenses

  # DB-backed provisioner tests. Their cycles self-skip when no server is
  # reachable (like the jj tests gate on jj_available), so they run for real
  # here and are no-ops in the main job. One job per ecosystem will grow here as
  # provisioners land (Ruby/Rails, Node, Python) — see
  # specs/workspace-provisioners.md.
  provisioners:
    name: Provisioner tests (Postgres)
    runs-on: ubuntu-latest
    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@v5
      - uses: dtolnay/rust-toolchain@stable
      - 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
      - uses: ruby/setup-ruby@v1
        with:
          ruby-version: "3.4"
      - 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@v4
        with:
          node-version: "22"
      - 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: "8.4"
      - 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@v4
        with:
          dotnet-version: "10.0.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: "27"
          elixir-version: "1.18"
      - 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: cargo test (DB-gated cycles run here)
        run: cargo test --locked