name: PR Auto-merge
on:
pull_request:
branches: [ main ]
paths-ignore:
- 'README.md'
- 'CONTRIBUTING.md'
- 'SECURITY.md'
- 'LICENSE'
- 'docs/**'
push:
branches: [ main ]
paths-ignore:
- 'README.md'
- 'CONTRIBUTING.md'
- 'SECURITY.md'
- 'LICENSE'
- 'docs/**'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env:
CARGO_TERM_COLOR: always
CARGO_PROFILE_DEV_DEBUG: line-tables-only
CARGO_PROFILE_TEST_DEBUG: line-tables-only
jobs:
lint:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
- name: Install taplo
uses: taiki-e/install-action@bffeee26d4db9be238a4ea78d8826604ebcb594d with:
tool: taplo-cli
- name: Lint Cargo.toml
run: taplo lint Cargo.toml
- name: Check Cargo.toml formatting
run: taplo fmt --check --option reorder_keys=true Cargo.toml
- name: Check formatting
run: cargo fmt -- --check
- name: Test GitHub Action step scripts
run: |
status=0
log="$RUNNER_TEMP/action-suite.log"
for suite in scripts/test_action_*.sh; do
echo "== $suite"
bash "$suite" > "$log" 2>&1 || status=1
cat "$log"
# A suite that dies mid-run (parse error, unset variable) never
# reaches its `finish` call, so the tally line is the only proof
# that every case actually executed.
if ! grep -q '^Results:' "$log"; then
echo "::error::$suite exited without a Results line -- it aborted before finishing"
status=1
fi
done
exit "$status"
test:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
timeout-minutes: 30
steps:
- name: Checkout repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
- name: Update Rust toolchain
run: rustup update stable
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 with:
save-if: ${{ github.ref == 'refs/heads/main' }}
cache-on-failure: true
- name: Run clippy
if: matrix.os == 'ubuntu-latest'
run: cargo clippy --all-targets --all-features -- -D warnings
- name: Run tests
run: cargo test --all-features
test-tauri:
runs-on: ubuntu-latest
timeout-minutes: 25
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
- name: Install system dependencies
timeout-minutes: 5
run: |
sudo apt-get update -o Acquire::Retries=3
sudo apt-get install -y -o Acquire::Retries=3 libgtk-3-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 with:
node-version: 24
- name: Install pnpm and frontend deps
run: corepack enable && corepack prepare pnpm@latest --activate && pnpm --dir ui install --frozen-lockfile
- name: Build frontend
run: pnpm --dir ui run build
- name: Update Rust toolchain
run: rustup update stable
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 with:
save-if: ${{ github.ref == 'refs/heads/main' }}
cache-on-failure: true
- name: Check Tauri compilation
run: cargo check -p cruise-gui