name: CI

on:
  push:
    branches:
      - master
      - beta
      - release
      - next
      - 'v*'
      - 'release-*'
      - 'lts-*'
  pull_request:
  schedule:
    - cron:  '0 3 * * *' # daily, at 3am

jobs:
  basic-tests:
    name: Basic Tests
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v1
      - uses: actions/setup-node@v1
        with:
          node-version: 12.x

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

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

      - run: yarn install
      - run: yarn lint
      - run: yarn test

  tests:
    name: Node.js ${{ matrix.node-version }}
    runs-on: ubuntu-latest

    needs: [basic-tests]

    strategy:
      matrix:
        node-version: [8.x, 10.x, 12.x]

    steps:
      - uses: actions/checkout@v1
      - uses: actions/setup-node@v1
        with:
          node-version: ${{ matrix.node-version }}

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

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

      - run: yarn install
      - run: yarn test:all

  feature-flags:
    name: "Feature Flag: ${{ matrix.feature-flag }}"
    runs-on: ubuntu-latest

    needs: [basic-tests]

    strategy:
      matrix:
        feature-flag:
          - EMBER_CLI_ENABLE_ALL_EXPERIMENTS
          - EMBER_CLI_PACKAGER
          - EMBER_CLI_MODULE_UNIFICATION
          - EMBER_CLI_DELAYED_TRANSPILATION
          - EMBER_CLI_SYSTEM_TEMP=
          - EMBER_CLI_BROCCOLI_WATCHER

    steps:
      - uses: actions/checkout@v1
      - uses: actions/setup-node@v1
        with:
          node-version: 12.x

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

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

      - run: yarn install
      - run: yarn test:all
        env:
          ${{ matrix.feature-flag }}: true

Add GitHub Actions CI workflow
Add GitHub Actions CI workflow
