ci.yml 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. name: CI
  2. on:
  3. push:
  4. branches: [main]
  5. pull_request:
  6. branches: [main]
  7. workflow_dispatch:
  8. jobs:
  9. changes:
  10. name: Detect changes
  11. runs-on: ubuntu-22.04
  12. outputs:
  13. rust: ${{ github.event_name == 'workflow_dispatch' && 'true' || steps.filter.outputs.rust }}
  14. steps:
  15. - name: Checkout
  16. if: github.event_name != 'workflow_dispatch'
  17. uses: actions/checkout@v5
  18. with:
  19. fetch-depth: 0
  20. - name: Filter paths
  21. if: github.event_name != 'workflow_dispatch'
  22. uses: dorny/paths-filter@v4
  23. id: filter
  24. with:
  25. filters: |
  26. rust:
  27. - 'src-tauri/**'
  28. # PR / manual only. Merge to main already passed this on the PR;
  29. # do not compile the same debug tree again.
  30. check:
  31. name: Check Ubuntu
  32. needs: changes
  33. if: github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'
  34. runs-on: ubuntu-22.04
  35. steps:
  36. - name: Checkout
  37. uses: actions/checkout@v5
  38. - name: Install Rust stable
  39. uses: dtolnay/rust-toolchain@stable
  40. - name: Install dependencies
  41. run: |
  42. sudo apt-get update
  43. sudo apt-get install -y curl libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf protobuf-compiler
  44. - name: Rust cache
  45. uses: Swatinem/rust-cache@v2
  46. with:
  47. workspaces: src-tauri
  48. cache-on-failure: true
  49. - name: Setup Node.js
  50. uses: actions/setup-node@v5
  51. with:
  52. node-version: 24
  53. cache: npm
  54. - name: Install frontend dependencies
  55. run: npm ci
  56. - name: Check frontend build
  57. run: npx vite build
  58. - name: Check Rust build
  59. working-directory: src-tauri
  60. run: cargo build
  61. check-windows:
  62. name: Check Windows (Rust)
  63. needs: changes
  64. if: >-
  65. (github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch') &&
  66. needs.changes.outputs.rust == 'true'
  67. runs-on: windows-latest
  68. steps:
  69. - name: Checkout
  70. uses: actions/checkout@v5
  71. - name: Install Rust stable
  72. uses: dtolnay/rust-toolchain@stable
  73. - name: Install protoc
  74. uses: arduino/setup-protoc@v3
  75. with:
  76. repo-token: ${{ secrets.GITHUB_TOKEN }}
  77. - name: Rust cache
  78. uses: Swatinem/rust-cache@v2
  79. with:
  80. workspaces: src-tauri
  81. cache-on-failure: true
  82. - name: Check Rust build
  83. working-directory: src-tauri
  84. run: cargo build