ci.yml 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. name: CI
  2. on:
  3. push:
  4. branches: [main]
  5. pull_request:
  6. branches: [main]
  7. jobs:
  8. check:
  9. strategy:
  10. fail-fast: false
  11. matrix:
  12. include:
  13. - platform: macos-latest
  14. pdfium_asset: pdfium-mac-arm64.tgz
  15. pdfium_library: libpdfium.dylib
  16. - platform: ubuntu-22.04
  17. pdfium_asset: pdfium-linux-x64.tgz
  18. pdfium_library: libpdfium.so
  19. - platform: windows-latest
  20. pdfium_asset: ""
  21. pdfium_library: ""
  22. runs-on: ${{ matrix.platform }}
  23. steps:
  24. - name: Checkout
  25. uses: actions/checkout@v4
  26. - name: Install Rust stable
  27. uses: dtolnay/rust-toolchain@stable
  28. - name: Install protoc (macOS)
  29. if: matrix.platform == 'macos-latest'
  30. run: brew install protobuf
  31. - name: Install dependencies (Ubuntu)
  32. if: matrix.platform == 'ubuntu-22.04'
  33. run: |
  34. sudo apt-get update
  35. sudo apt-get install -y curl libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf protobuf-compiler
  36. - name: Install protoc (Windows)
  37. if: matrix.platform == 'windows-latest'
  38. run: choco install protoc -y
  39. - name: Install PDFium binary
  40. if: matrix.pdfium_asset != ''
  41. shell: bash
  42. run: |
  43. set -euo pipefail
  44. mkdir -p "$RUNNER_TEMP/pdfium" src-tauri/pdfium
  45. curl -L --fail --retry 5 --retry-delay 2 \
  46. -o "$RUNNER_TEMP/pdfium.tgz" \
  47. "https://github.com/bblanchon/pdfium-binaries/releases/latest/download/${{ matrix.pdfium_asset }}"
  48. tar -xzf "$RUNNER_TEMP/pdfium.tgz" -C "$RUNNER_TEMP/pdfium"
  49. cp "$RUNNER_TEMP/pdfium/lib/${{ matrix.pdfium_library }}" "src-tauri/pdfium/${{ matrix.pdfium_library }}"
  50. ls -la src-tauri/pdfium
  51. - name: Rust cache
  52. uses: Swatinem/rust-cache@v2
  53. with:
  54. workspaces: src-tauri
  55. - name: Setup Node.js
  56. uses: actions/setup-node@v4
  57. with:
  58. node-version: 24
  59. - name: Install frontend dependencies
  60. run: npm install
  61. - name: Check frontend build
  62. run: npx vite build
  63. - name: Check Rust build
  64. working-directory: src-tauri
  65. run: cargo build