Skip to content

ci: run phase checks on feature branches #113

ci: run phase checks on feature branches

ci: run phase checks on feature branches #113

Workflow file for this run

name: CI
on:
push:
# Phase-gated feature branches must receive the same remote validation as
# the protected integration branches before their next stage can begin.
branches: ["**"]
pull_request:
branches: [main, master]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
frontend-check:
name: Frontend (TypeScript + Vitest)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Install dependencies
run: npm ci
- name: TypeScript type check
run: npx tsc --noEmit
- name: Run tests
run: npm run test
- name: Build frontend
run: npx vite build
rust-check:
name: Rust (cargo check + clippy + test)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libwebkit2gtk-4.1-dev \
libappindicator3-dev \
librsvg2-dev \
patchelf \
libssl-dev \
libgtk-3-dev \
libsoup-3.0-dev \
javascriptcoregtk-4.1-dev
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- uses: Swatinem/rust-cache@v2
with:
workspaces: src-tauri
- uses: taiki-e/install-action@nextest
- name: Check formatting
working-directory: src-tauri
run: cargo fmt --check
- name: Clippy lints
working-directory: src-tauri
run: cargo clippy --all-targets --all-features -- -D warnings
- name: Run tests
working-directory: src-tauri
env:
# GitHub Linux runners can crash GNU ld when linking many large Tauri
# integration test binaries concurrently. Keep test compilation serial
# and omit debug info to reduce linker pressure.
CARGO_BUILD_JOBS: 1
CARGO_PROFILE_TEST_DEBUG: 0
run: cargo nextest run --all-features --profile ci
- name: Build check
working-directory: src-tauri
run: cargo build
terminal-runtime-test:
name: Terminal Runtime (${{ matrix.os }})
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install system dependencies (Linux)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y \
libwebkit2gtk-4.1-dev \
libappindicator3-dev \
librsvg2-dev \
patchelf \
libssl-dev \
libgtk-3-dev \
libsoup-3.0-dev \
javascriptcoregtk-4.1-dev
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
workspaces: src-tauri
- name: Report runner and shell inventory (Unix)
if: runner.os != 'Windows'
run: |
uname -a
if [ "$RUNNER_OS" = "macOS" ]; then
sw_vers
else
cat /etc/os-release
fi
for shell in zsh bash sh fish; do
command -v "$shell" || true
done
- name: Report runner and shell inventory (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
Get-CimInstance Win32_OperatingSystem |
Select-Object Caption, Version, OSArchitecture |
Format-List
Get-Command powershell, pwsh, cmd -ErrorAction SilentlyContinue |
Select-Object Name, Source, Version |
Format-Table -AutoSize
- name: Run real PTY integration tests
working-directory: src-tauri
env:
CARGO_BUILD_JOBS: 1
CARGO_PROFILE_TEST_DEBUG: 0
run: cargo test --all-features --test terminal_manager_tests -- --nocapture
tauri-build:
name: Tauri Build (${{ matrix.os }})
needs: [frontend-check, rust-check, terminal-runtime-test]
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- os: windows-latest
target: x86_64-pc-windows-msvc
- os: macos-latest
target: aarch64-apple-darwin
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Install dependencies (npm)
run: npm ci
- name: Install system dependencies (Linux)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y \
libwebkit2gtk-4.1-dev \
libappindicator3-dev \
librsvg2-dev \
patchelf \
libssl-dev \
libgtk-3-dev \
libsoup-3.0-dev \
javascriptcoregtk-4.1-dev
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- uses: Swatinem/rust-cache@v2
with:
workspaces: src-tauri
- name: Build Tauri app
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
args: --target ${{ matrix.target }}