aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/.github/workflows/test.yml
blob: b5311c9d223f8d7d49c4247001131c98ac91f803 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: Test & Build

on:
  push:
    branches: ["main"]
    paths-ignore:
      - "**.md"
      - "ui/**"
  pull_request:
    branches: ["main"]
  workflow_dispatch:

env:
  CARGO_TERM_COLOR: always

jobs:
  test:
    name: Test on ${{ matrix.platform }}
    runs-on: ${{ matrix.platform }}
    strategy:
      fail-fast: false
      matrix:
        # On Push: Linux only. On PR: All platforms.
        platform: ${{ (github.event_name == 'pull_request') && fromJson('["ubuntu-22.04", "windows-latest", "macos-14"]') || fromJson('["ubuntu-22.04"]') }}

    steps:
      - uses: actions/checkout@v4

      - name: Install Dependencies (Linux)
        if: runner.os == 'Linux'
        run: |
          sudo apt-get update
          sudo apt-get install -y libwebkit2gtk-4.1-dev build-essential curl wget file libssl-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev

      - name: Install Rust
        uses: dtolnay/rust-toolchain@stable

      - name: Rust Cache
        uses: swatinem/rust-cache@v2
        with:
          workspaces: ./src-tauri

      - name: Run Tests
        working-directory: ./src-tauri
        run: cargo test --verbose

      - name: Build (Dev)
        working-directory: ./src-tauri
        run: cargo build --verbose