109 lines
2.7 KiB
YAML
109 lines
2.7 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
frontend:
|
|
runs-on: ubuntu-22.04
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Setup pnpm
|
|
uses: pnpm/action-setup@v6
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 22.13.0
|
|
cache: pnpm
|
|
|
|
- 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 libsecret-1-dev
|
|
|
|
- name: Install frontend dependencies
|
|
run: pnpm install --frozen-lockfile
|
|
|
|
- name: Frontend format check
|
|
run: npx oxfmt --check "apps/desktop/src/**/*.{ts,vue}"
|
|
|
|
- name: TypeScript check
|
|
run: npx vue-tsc --noEmit --project apps/desktop/tsconfig.json
|
|
|
|
- name: Frontend tests
|
|
run: pnpm test
|
|
|
|
- name: Node package tests
|
|
run: pnpm test:packages
|
|
|
|
- name: Node package publish dry run
|
|
run: pnpm publish:dry-run
|
|
|
|
rust:
|
|
runs-on: ubuntu-22.04
|
|
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 libsecret-1-dev
|
|
|
|
- name: Setup Rust
|
|
uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
components: clippy
|
|
|
|
- name: Rust cache
|
|
uses: swatinem/rust-cache@v2
|
|
with:
|
|
workspaces: './ -> target'
|
|
shared-key: ci-x86_64-unknown-linux-gnu
|
|
|
|
- name: Cargo fmt check
|
|
run: cargo fmt --check
|
|
|
|
- name: Cargo clippy
|
|
run: cargo clippy --workspace --locked
|
|
|
|
- name: Cargo check
|
|
run: cargo check --workspace --locked
|
|
|
|
- name: Cargo test
|
|
run: cargo test --workspace --locked
|
|
|
|
jdbc:
|
|
runs-on: ubuntu-22.04
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Setup Java
|
|
uses: actions/setup-java@v4
|
|
with:
|
|
distribution: temurin
|
|
java-version: '17'
|
|
cache: maven
|
|
|
|
- name: JDBC plugin version guard
|
|
env:
|
|
BASE_SHA: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || github.event.before }}
|
|
run: |
|
|
if [ -z "$BASE_SHA" ] || echo "$BASE_SHA" | grep -Eq '^0+$'; then
|
|
BASE_SHA="HEAD~1"
|
|
fi
|
|
node .github/scripts/check-jdbc-plugin-version.mjs "$BASE_SHA" HEAD
|
|
|
|
- name: JDBC plugin package check
|
|
run: ./plugins/jdbc/package.sh
|