tauri_ci.yaml 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. name: Tauri-CI
  2. on:
  3. pull_request:
  4. paths:
  5. - ".github/workflows/tauri_ci.yaml"
  6. - "frontend/rust-lib/**"
  7. - "frontend/appflowy_tauri/**"
  8. env:
  9. NODE_VERSION: "18.16.0"
  10. PNPM_VERSION: "8.5.0"
  11. RUST_TOOLCHAIN: "1.70"
  12. concurrency:
  13. group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
  14. cancel-in-progress: true
  15. jobs:
  16. tauri-build:
  17. if: github.event.pull_request.draft != true
  18. strategy:
  19. fail-fast: false
  20. matrix:
  21. # platform: [macos-latest, ubuntu-latest, windows-latest]
  22. platform: [ubuntu-latest]
  23. runs-on: ${{ matrix.platform }}
  24. steps:
  25. - uses: actions/checkout@v3
  26. - name: setup node
  27. uses: actions/setup-node@v3
  28. with:
  29. node-version: ${{ env.NODE_VERSION }}
  30. - name: Install Rust toolchain
  31. id: rust_toolchain
  32. uses: actions-rs/toolchain@v1
  33. with:
  34. toolchain: ${{ env.RUST_TOOLCHAIN }}
  35. override: true
  36. profile: minimal
  37. - uses: Swatinem/rust-cache@v2
  38. with:
  39. prefix-key: 'ubuntu-latest-tauri'
  40. workspaces: |
  41. frontend/rust-lib
  42. frontend/appflowy_tauri/src-tauri
  43. - name: install dependencies (windows only)
  44. if: matrix.platform == 'windows-latest'
  45. working-directory: frontend
  46. run: |
  47. cargo install --force cargo-make
  48. cargo install --force duckscript_cli
  49. vcpkg integrate install
  50. cargo make appflowy-tauri-deps-tools
  51. npm install -g pnpm@${{ env.PNPM_VERSION }}
  52. - name: install dependencies (ubuntu only)
  53. if: matrix.platform == 'ubuntu-latest'
  54. working-directory: frontend
  55. run: |
  56. sudo apt-get update
  57. sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf
  58. cargo install --force cargo-make
  59. cargo make appflowy-tauri-deps-tools
  60. npm install -g pnpm@${{ env.PNPM_VERSION }}
  61. - name: install dependencies (macOS only)
  62. if: matrix.platform == 'macos-latest'
  63. working-directory: frontend
  64. run: |
  65. cargo install --force cargo-make
  66. cargo make appflowy-tauri-deps-tools
  67. npm install -g pnpm@${{ env.PNPM_VERSION }}
  68. - name: build
  69. working-directory: frontend/appflowy_tauri
  70. run: |
  71. mkdir dist
  72. pnpm install
  73. cargo make --cwd .. tauri_build
  74. pnpm test:errors
  75. - uses: tauri-apps/tauri-action@v0
  76. env:
  77. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}