test.yml 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. name: Test CI
  2. on:
  3. workflow_dispatch:
  4. inputs:
  5. os:
  6. description: "Runs on OS"
  7. required: true
  8. default: windows-latest
  9. type: choice
  10. options:
  11. - windows-latest
  12. - ubuntu-latest
  13. - macos-latest
  14. - ubuntu-18.04
  15. - ubuntu-20.04
  16. - ubuntu-22.04
  17. - macos-10.15
  18. - macos-11
  19. - macos-12
  20. - windows-2019
  21. - windows-2022
  22. env:
  23. CARGO_INCREMENTAL: 0
  24. RUST_BACKTRACE: short
  25. jobs:
  26. release:
  27. runs-on: ${{ github.event.inputs.os }}
  28. if: startsWith(github.repository, 'zzzgydi')
  29. steps:
  30. - name: Checkout repository
  31. uses: actions/checkout@v2
  32. - name: Install Rust
  33. uses: actions-rs/toolchain@v1
  34. with:
  35. toolchain: stable
  36. profile: minimal
  37. override: true
  38. - name: Rust Cache
  39. uses: Swatinem/rust-cache@v1
  40. with:
  41. working-directory: src-tauri
  42. - name: Install Node
  43. uses: actions/setup-node@v1
  44. with:
  45. node-version: 14
  46. - name: Install Dependencies (ubuntu only)
  47. if: startsWith(github.event.inputs.os, 'ubuntu-')
  48. run: |
  49. sudo apt-get update
  50. sudo apt-get install -y libwebkit2gtk-4.0-dev build-essential curl wget libssl-dev libgtk-3-dev libappindicator3-dev librsvg2-dev libayatana-appindicator3-dev
  51. - name: Install ARM64 toolchain (windows only)
  52. if: startsWith(matrix.os, 'windows-')
  53. run: |
  54. rustup target add aarch64-pc-windows-msvc
  55. - name: Get yarn cache dir path
  56. id: yarn-cache-dir-path
  57. run: echo "::set-output name=dir::$(yarn cache dir)"
  58. - name: Yarn Cache
  59. uses: actions/cache@v2
  60. id: yarn-cache
  61. with:
  62. path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
  63. key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
  64. restore-keys: |
  65. ${{ runner.os }}-yarn-
  66. - name: Yarn install and check
  67. run: |
  68. yarn install --network-timeout 1000000
  69. yarn run check
  70. - name: Tauri build
  71. uses: tauri-apps/tauri-action@0e558392ccadcb49bcc89e7df15a400e8f0c954d
  72. env:
  73. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  74. TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
  75. TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
  76. - name: Tauri build arm64 (windows only)
  77. if: startsWith(matrix.os, 'windows-')
  78. uses: tauri-apps/tauri-action@0e558392ccadcb49bcc89e7df15a400e8f0c954d
  79. # enable cache even though failed
  80. # continue-on-error: true
  81. env:
  82. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  83. TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
  84. TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
  85. with:
  86. args: --target aarc64-pc-windows-msvc