name: Build and Test

on: push

jobs:
  build-and-test:
    name: Build and Test Web and Electron Apps
    runs-on: ubuntu-latest

    steps:
      - name: Checkout repo
        uses: actions/checkout@v1

      - name: Install Node.js, NPM and Yarn
        uses: actions/setup-node@v1
        with:
          node-version: 10

      - name: Show Environment Info
        run: yarn -v

      - name: Get yarn cache directory path
        id: yarn-cache-dir-path
        run: echo "::set-output name=dir::$(yarn cache dir)"

      - name: Check yarn cache
        uses: actions/cache@v2
        with:
          path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
          key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
          restore-keys: |
            ${{ runner.os }}-yarn-
      
      - name: Install dependencies
        run: yarn --prefer-offline

      - name: Build web app
        run: yarn gulp build --platform=browser
      
      - name: Test web app
        run: yarn do scripts/test

      - name: Build Electron app
        run: yarn do src/electron/build

name: Build and Test

# See https://docs.github.com/en/actions/reference/events-that-trigger-workflows
on: [push, pull_request]

jobs:
  build-and-test:
    name: Build and Test Web and Electron Apps
    runs-on: ubuntu-latest

    steps:
      - name: Checkout repo
        uses: actions/checkout@v1

      - name: Install Node.js, NPM and Yarn
        uses: actions/setup-node@v1
        with:
          node-version: 10

      - name: Show Environment Info
        run: yarn -v

      - name: Get yarn cache directory path
        id: yarn-cache-dir-path
        run: echo "::set-output name=dir::$(yarn cache dir)"

      - name: Check yarn cache
        uses: actions/cache@v2
        with:
          path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
          key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
          restore-keys: |
            ${{ runner.os }}-yarn-
      
      - name: Install dependencies
        run: yarn --prefer-offline

      - name: Build web app
        run: yarn gulp build --platform=browser
      
      - name: Test web app
        run: yarn do scripts/test

      - name: Build Electron app
        run: yarn do src/electron/build

Enable Github actions for external PRs
Enable Github actions for external PRs