Skip to content
Snippets Groups Projects
test.yml 2.1 KiB
Newer Older
GyDi's avatar
GyDi committed
name: Test CI

GyDi's avatar
GyDi committed
on:
  workflow_dispatch:
    inputs:
      os:
        description: "Runs on OS"
        required: true
        default: windows-latest
        type: choice
        options:
          - windows-latest
          - ubuntu-latest
          - macos-latest
GyDi's avatar
GyDi committed
          - ubuntu-18.04
          - ubuntu-20.04
          - ubuntu-22.04
          - macos-10.15
          - macos-11
          - macos-12
          - windows-2019
          - windows-2022
GyDi's avatar
GyDi committed

env:
  CARGO_INCREMENTAL: 0
  RUST_BACKTRACE: short

jobs:
  release:
GyDi's avatar
GyDi committed
    runs-on: ${{ github.event.inputs.os }}
GyDi's avatar
GyDi committed
    if: startsWith(github.repository, 'zzzgydi')
    steps:
GyDi's avatar
GyDi committed
      - name: System Version
        run: |
          echo ${{ github.event.inputs.os }}

GyDi's avatar
GyDi committed
      - name: Checkout repository
        uses: actions/checkout@v2

GyDi's avatar
GyDi committed
      - name: install Rust stable
        uses: dtolnay/rust-toolchain@stable
GyDi's avatar
GyDi committed

GyDi's avatar
GyDi committed
      - name: Rust Cache
GyDi's avatar
GyDi committed
        uses: Swatinem/rust-cache@v2
GyDi's avatar
GyDi committed
        with:
GyDi's avatar
GyDi committed
          workspaces: src-tauri
GyDi's avatar
GyDi committed

GyDi's avatar
GyDi committed
      - name: Install Node
        uses: actions/setup-node@v1
        with:
GyDi's avatar
GyDi committed
          node-version: 16
GyDi's avatar
GyDi committed

      - name: Install Dependencies (ubuntu only)
GyDi's avatar
GyDi committed
        if: startsWith(github.event.inputs.os, 'ubuntu-')
GyDi's avatar
GyDi committed
        run: |
          sudo apt-get update
GyDi's avatar
GyDi committed
          sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf
GyDi's avatar
GyDi committed

GyDi's avatar
GyDi committed
      - name: Get yarn cache dir path
        id: yarn-cache-dir-path
        run: echo "::set-output name=dir::$(yarn cache dir)"

      - name: Yarn Cache
        uses: actions/cache@v2
        id: yarn-cache
        with:
          path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
          key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
          restore-keys: |
            ${{ runner.os }}-yarn-

      - name: Yarn install and check
        run: |
          yarn install --network-timeout 1000000
GyDi's avatar
GyDi committed
          yarn run check
GyDi's avatar
GyDi committed

GyDi's avatar
GyDi committed
      - name: Tauri build
GyDi's avatar
GyDi committed
        uses: tauri-apps/tauri-action@v0
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
          TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}