Skip to content

ci(release): unify cache keys with ci.yml, drop tag-scope writes #152

ci(release): unify cache keys with ci.yml, drop tag-scope writes

ci(release): unify cache keys with ci.yml, drop tag-scope writes #152

Workflow file for this run

name: CI
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
env:
CARGO_TERM_COLOR: always
jobs:
check:
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: pnpm/action-setup@v4
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: '22.14.0'
cache: pnpm
cache-dependency-path: grove-web/pnpm-lock.yaml
- name: Build frontend dist
run: |
pnpm install --frozen-lockfile
pnpm run build
working-directory: grove-web
- run: cargo check
fmt:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- run: cargo fmt --all -- --check
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: pnpm/action-setup@v4
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: '22.14.0'
cache: pnpm
cache-dependency-path: grove-web/pnpm-lock.yaml
- name: Build frontend dist
run: |
pnpm install --frozen-lockfile
pnpm run build
working-directory: grove-web
- run: cargo clippy -- -D warnings
eslint:
name: ESLint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: '22.14.0'
cache: pnpm
cache-dependency-path: grove-web/pnpm-lock.yaml
- run: pnpm install --frozen-lockfile
working-directory: grove-web
- run: pnpm eslint src/ --max-warnings 0
working-directory: grove-web
build:
name: Build (${{ matrix.cache-key }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
cache-key: linux-x64-musl
target: x86_64-unknown-linux-musl
- os: ubuntu-22.04
cache-key: ci-linux-x64-gnu-gui
target: x86_64-unknown-linux-gnu
features: gui
- os: ubuntu-latest
cache-key: linux-arm-cross
target: aarch64-unknown-linux-musl
use-cross: true
cache-all-crates: true
- os: macos-latest
cache-key: macos-arm-gui
target: aarch64-apple-darwin
features: gui
- os: macos-latest
cache-key: macos-intel-gui
target: x86_64-apple-darwin
features: gui
- os: macos-latest
cache-key: macos-dmg-universal
target: aarch64-apple-darwin
extra-target: x86_64-apple-darwin
features: gui
cache-all-crates: true
- os: windows-latest
cache-key: ci-windows-x64-gui
target: x86_64-pc-windows-msvc
features: gui
- os: windows-latest
cache-key: windows-arm64
target: aarch64-pc-windows-msvc
# ARM64 cross-compile from x64 host: may fail for C-dependent crates (rusqlite, ring)
best-effort: true
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ !matrix.use-cross && (matrix.extra-target && format('{0},{1}', matrix.target, matrix.extra-target) || matrix.target) || '' }}
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.cache-key }}
add-job-id-key: false
cache-all-crates: ${{ matrix.cache-all-crates || false }}
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22.14.0'
cache: pnpm
cache-dependency-path: grove-web/pnpm-lock.yaml
- name: Cache Tauri CLI binary (macOS only)
if: matrix.os == 'macos-latest'
uses: actions/cache@v4
id: cache-tauri
with:
path: ~/.cargo/bin/cargo-tauri
key: cargo-tauri-2.10.0-${{ runner.os }}
- name: Install Tauri CLI (macOS only, if not cached)
if: matrix.os == 'macos-latest' && steps.cache-tauri.outputs.cache-hit != 'true'
run: cargo install tauri-cli --version "=2.10.0" --locked
- name: Build frontend dist
shell: bash
run: |
pnpm install --frozen-lockfile
pnpm run build
working-directory: grove-web
- name: Install musl tools
if: matrix.cache-key == 'linux-x64-musl'
run: sudo apt-get update && sudo apt-get install -y musl-tools
- name: Install Linux GUI dependencies
if: matrix.cache-key == 'ci-linux-x64-gnu-gui'
run: |
sudo apt-get update
sudo apt-get install -y \
libwebkit2gtk-4.1-dev \
libgtk-3-dev \
build-essential \
curl \
wget \
file \
libxdo-dev \
libssl-dev \
libayatana-appindicator3-dev \
librsvg2-dev
- name: Install cross
if: matrix.use-cross
run: cargo install cross --git https://github.com/cross-rs/cross
- name: Build
shell: bash
continue-on-error: ${{ matrix.best-effort == true }}
run: |
if [ "${{ matrix.use-cross }}" = "true" ]; then
cross build --release --target ${{ matrix.target }}
else
cargo build --release --target ${{ matrix.target }} ${{ matrix.features && format('--features {0}', matrix.features) || '' }}
fi
- name: Build extra target (universal DMG warm-up)
if: matrix.extra-target != ''
shell: bash
run: cargo build --release --target ${{ matrix.extra-target }} ${{ matrix.features && format('--features {0}', matrix.features) || '' }}