Files
tatsumi/.gitea/workflows/ci.yml
T
hikari 42b4958c2a
Security Scan and Upload / Security & DefectDojo Upload (pull_request) Successful in 1m18s
CI / Lint & Check (pull_request) Successful in 14m56s
CI / Build Windows (pull_request) Failing after 2m31s
fix(ci): pin LLVM 18 for Windows cross-compilation
Older llvm-rc versions cannot handle PNG-compressed ICO entries,
causing the Windows build to fail. Pinning to LLVM 18 and setting
up alternatives ensures llvm-rc, clang-cl, and lld-link all resolve
to a version that handles the icon resource correctly.
2026-04-13 11:50:36 -07:00

143 lines
3.8 KiB
YAML

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
jobs:
lint-and-check:
name: Lint & Check
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Check dependency pins
uses: naomi-lgbt/dependency-pin-check@main
with:
language: javascript
dev-dependencies: true
peer-dependencies: true
optional-dependencies: true
- name: Install Linux dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libwebkit2gtk-4.1-dev \
librsvg2-dev \
patchelf \
libgtk-3-dev \
libayatana-appindicator3-dev
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
- name: Install frontend dependencies
run: pnpm install
- name: Run ESLint
run: pnpm lint
- name: Build frontend
run: pnpm build
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- name: Cache Rust dependencies
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
src-tauri/target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Run Clippy
working-directory: src-tauri
run: cargo clippy --all-targets --all-features -- -D warnings
build-windows:
name: Build Windows
runs-on: ubuntu-latest
needs: lint-and-check
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Linux dependencies for cross-compilation
run: |
sudo apt-get update
sudo apt-get install -y \
libwebkit2gtk-4.1-dev \
librsvg2-dev \
patchelf \
libgtk-3-dev \
libayatana-appindicator3-dev \
clang-18 \
lld-18 \
llvm-18 \
nsis
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-18 100
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-18 100
sudo update-alternatives --install /usr/bin/clang-cl clang-cl /usr/bin/clang-cl-18 100
sudo update-alternatives --install /usr/bin/lld lld /usr/bin/lld-18 100
sudo update-alternatives --install /usr/bin/lld-link lld-link /usr/bin/lld-link-18 100
sudo update-alternatives --install /usr/bin/llvm-rc llvm-rc /usr/bin/llvm-rc-18 100
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
- name: Install frontend dependencies
run: pnpm install
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-pc-windows-msvc
- name: Install cargo-xwin
run: |
curl -fsSL https://github.com/rust-cross/cargo-xwin/releases/download/v0.20.2/cargo-xwin-v0.20.2.x86_64-unknown-linux-musl.tar.gz | tar xz
sudo mv cargo-xwin /usr/local/bin/
- name: Cache Rust dependencies
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
src-tauri/target/
key: ${{ runner.os }}-cargo-windows-${{ hashFiles('**/Cargo.lock') }}
- name: Build Windows
run: pnpm build:windows