test.yml 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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: System Version
  31. run: |
  32. echo ${{ github.event.inputs.os }}
  33. - name: Checkout repository
  34. uses: actions/checkout@v2
  35. - name: Install Rust
  36. uses: actions-rs/toolchain@v1
  37. with:
  38. toolchain: stable
  39. profile: minimal
  40. override: true
  41. - name: Rust Cache
  42. uses: Swatinem/rust-cache@v1
  43. with:
  44. working-directory: src-tauri
  45. - name: Install Node
  46. uses: actions/setup-node@v1
  47. with:
  48. node-version: 14
  49. - name: Install Dependencies (ubuntu only)
  50. if: startsWith(github.event.inputs.os, 'ubuntu-')
  51. run: |
  52. sudo apt-get update
  53. sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf
  54. - name: Get yarn cache dir path
  55. id: yarn-cache-dir-path
  56. run: echo "::set-output name=dir::$(yarn cache dir)"
  57. - name: Yarn Cache
  58. uses: actions/cache@v2
  59. id: yarn-cache
  60. with:
  61. path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
  62. key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
  63. restore-keys: |
  64. ${{ runner.os }}-yarn-
  65. - name: Yarn install and check
  66. run: |
  67. yarn install --network-timeout 1000000
  68. yarn run check
  69. - name: Tauri build
  70. uses: tauri-apps/tauri-action@0e558392ccadcb49bcc89e7df15a400e8f0c954d
  71. env:
  72. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  73. TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
  74. TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}