| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140 |
- name: CI
- on:
- push:
- branches: [main]
- pull_request:
- branches: [main]
- workflow_dispatch:
- jobs:
- check:
- strategy:
- fail-fast: false
- matrix:
- include:
- - platform: macos-latest
- - platform: ubuntu-22.04
- - platform: windows-latest
- runs-on: ${{ matrix.platform }}
- steps:
- - name: Checkout
- uses: actions/checkout@v5
- - name: Install Rust stable
- uses: dtolnay/rust-toolchain@stable
- - name: Install protoc (macOS)
- if: matrix.platform == 'macos-latest'
- run: |
- brew untap aws/tap || true
- brew install protobuf
- - name: Install dependencies (Ubuntu)
- if: matrix.platform == 'ubuntu-22.04'
- run: |
- sudo apt-get update
- sudo apt-get install -y curl libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf protobuf-compiler
- - name: Install protoc (Windows)
- if: matrix.platform == 'windows-latest'
- uses: arduino/setup-protoc@v3
- with:
- repo-token: ${{ secrets.GITHUB_TOKEN }}
- - name: Rust cache
- uses: Swatinem/rust-cache@v2
- with:
- workspaces: src-tauri
- cache-on-failure: true
- - name: Setup Node.js
- uses: actions/setup-node@v5
- with:
- node-version: 24
- - name: Install frontend dependencies
- run: npm install
- - name: Check frontend build
- run: npx vite build
- - name: Check Rust build
- working-directory: src-tauri
- run: cargo build
- # Warm target/release on the default branch so tag builds can restore it.
- # GitHub cache is ref-scoped: tags cannot see other tags, but they can see main.
- # Windows also runs on PRs so this branch can measure release compile time.
- release-compile:
- name: Release compile ${{ matrix.display }}
- if: github.event_name != 'pull_request' || matrix.on_pr
- runs-on: ${{ matrix.platform }}
- env:
- CARGO_PROFILE_RELEASE_LTO: "false"
- CARGO_PROFILE_RELEASE_CODEGEN_UNITS: "16"
- CARGO_PROFILE_RELEASE_OPT_LEVEL: "1"
- strategy:
- fail-fast: false
- matrix:
- include:
- - platform: windows-latest
- display: Windows x64
- on_pr: true
- - platform: ubuntu-22.04
- display: Linux x64
- on_pr: false
- - platform: macos-latest
- display: macOS
- on_pr: false
- steps:
- - name: Checkout
- uses: actions/checkout@v5
- - name: Install Rust stable
- uses: dtolnay/rust-toolchain@stable
- - name: Install protoc (macOS)
- if: matrix.platform == 'macos-latest'
- run: |
- brew untap aws/tap || true
- brew install protobuf
- - name: Install dependencies (Ubuntu)
- if: matrix.platform == 'ubuntu-22.04'
- run: |
- sudo apt-get update
- sudo apt-get install -y curl libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf protobuf-compiler
- - name: Install protoc (Windows)
- if: matrix.platform == 'windows-latest'
- uses: arduino/setup-protoc@v3
- with:
- repo-token: ${{ secrets.GITHUB_TOKEN }}
- - name: Rust cache
- uses: Swatinem/rust-cache@v2
- with:
- workspaces: src-tauri
- shared-key: qmai-release
- add-job-id-key: false
- cache-on-failure: true
- - name: Setup Node.js
- uses: actions/setup-node@v5
- with:
- node-version: 24
- cache: npm
- - name: Install frontend dependencies
- run: npm ci
- - name: Build frontend
- run: npx vite build
- - name: Cargo release build
- working-directory: src-tauri
- run: cargo build --release
|