75 lines
2.1 KiB
YAML
75 lines
2.1 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
|
|
concurrency:
|
|
group: ci-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
check:
|
|
runs-on: macos-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
cache: npm
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
components: clippy
|
|
- uses: Swatinem/rust-cache@v2
|
|
- run: npm ci
|
|
- name: Frontend (typecheck + build)
|
|
run: npm run build
|
|
- name: Tests
|
|
run: cargo test --workspace
|
|
- name: Clippy
|
|
run: cargo clippy --workspace -- -D warnings
|
|
|
|
# The Windows and Linux builds compile different code (src/native); check them too.
|
|
check-windows:
|
|
runs-on: windows-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
components: clippy
|
|
- uses: Swatinem/rust-cache@v2
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
cache: npm
|
|
# tauri::generate_context! needs the built frontend.
|
|
- run: npm ci && npm run build
|
|
- name: Clippy (desktop + tools)
|
|
run: cargo clippy -p openclicky-desktop -p openclicky-tools -- -D warnings
|
|
- name: Tests
|
|
run: cargo test -p openclicky-desktop -p openclicky-tools
|
|
|
|
check-linux:
|
|
runs-on: ubuntu-22.04
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: System libraries
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y libwebkit2gtk-4.1-dev libayatana-appindicator3-dev librsvg2-dev libxdo-dev libasound2-dev
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
components: clippy
|
|
- uses: Swatinem/rust-cache@v2
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
cache: npm
|
|
# tauri::generate_context! needs the built frontend.
|
|
- run: npm ci && npm run build
|
|
- name: Clippy (desktop + tools)
|
|
run: cargo clippy -p openclicky-desktop -p openclicky-tools -- -D warnings
|
|
- name: Tests
|
|
run: cargo test -p openclicky-desktop -p openclicky-tools
|