tauri_ci.yaml 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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: Cache Rust Dependencies
  31. uses: Swatinem/rust-cache@v2
  32. with:
  33. key: rust-dependencies-${{ runner.os }}
  34. workspaces: |
  35. frontend/rust-lib
  36. frontend/appflowy_tauri/src-tauri
  37. - name: Cache Node.js dependencies
  38. uses: actions/cache@v2
  39. with:
  40. path: ~/.npm
  41. key: npm-${{ runner.os }}
  42. - name: Cache node_modules
  43. uses: actions/cache@v2
  44. with:
  45. path: frontend/appflowy_tauri/node_modules
  46. key: node-modules-${{ runner.os }}
  47. - name: Install Rust toolchain
  48. id: rust_toolchain
  49. uses: actions-rs/toolchain@v1
  50. with:
  51. toolchain: ${{ env.RUST_TOOLCHAIN }}
  52. override: true
  53. profile: minimal
  54. - name: install dependencies (windows only)
  55. if: matrix.platform == 'windows-latest'
  56. working-directory: frontend
  57. run: |
  58. cargo install --force cargo-make
  59. cargo install --force duckscript_cli
  60. vcpkg integrate install
  61. cargo make appflowy-tauri-deps-tools
  62. npm install -g pnpm@${{ env.PNPM_VERSION }}
  63. - name: install dependencies (ubuntu only)
  64. if: matrix.platform == 'ubuntu-latest'
  65. working-directory: frontend
  66. run: |
  67. sudo apt-get update
  68. sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf
  69. cargo install --force cargo-make
  70. cargo make appflowy-tauri-deps-tools
  71. npm install -g pnpm@${{ env.PNPM_VERSION }}
  72. - name: install dependencies (macOS only)
  73. if: matrix.platform == 'macos-latest'
  74. working-directory: frontend
  75. run: |
  76. cargo install --force cargo-make
  77. cargo make appflowy-tauri-deps-tools
  78. npm install -g pnpm@${{ env.PNPM_VERSION }}
  79. - name: Build
  80. working-directory: frontend/appflowy_tauri
  81. run: |
  82. mkdir dist
  83. pnpm install
  84. cargo make --cwd .. tauri_build
  85. pnpm test
  86. pnpm test:errors
  87. - name: Check for uncommitted changes
  88. run: |
  89. diff_files=$(git status --porcelain)
  90. if [ -n "$diff_files" ]; then
  91. echo "There are uncommitted changes in the working tree. Please commit them before pushing."
  92. exit 1
  93. fi
  94. - uses: tauri-apps/tauri-action@v0
  95. env:
  96. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}