name: Tests

on:
  push:
    branches:
      - master
      - ci
  pull_request:
    branches:
      - master

jobs:
  test:
    runs-on: ${{ matrix.os }}
    strategy:
      max-parallel: 4
      matrix:
        node-version: ["10", "11", "12", "13"]
        os: [ubuntu-latest]
        edgedb-version: ["stable", "nightly"]

    steps:
      - uses: actions/checkout@v1
        with:
          fetch-depth: 50

      - name: Set up Node ${{ matrix.node-version }}
        uses: actions/setup-node@v1
        with:
          node-version: ${{ matrix.node-version }}

      - name: Install dev deps
        run: |
          yarn install

      - name: Lint
        run: |
          yarn lint

      - name: Install EdgeDB
        uses: edgedb/setup-edgedb@v1
        with:
          server-version: ${{ matrix.edgedb-version }}

      - name: Run functional tests
        run: |
          yarn test

name: Tests

on:
  push:
    branches:
      - master
      - ci
  pull_request:
    branches:
      - master

jobs:
  test:
    runs-on: ${{ matrix.os }}
    strategy:
      max-parallel: 4
      matrix:
        node-version: ["10", "11", "12", "13"]
        os: [ubuntu-latest]
        edgedb-version: ["stable", "nightly"]

    steps:
      - uses: actions/checkout@v1
        with:
          fetch-depth: 50

      - name: Set up Node ${{ matrix.node-version }}
        uses: actions/setup-node@v1
        with:
          node-version: ${{ matrix.node-version }}

      - name: Install dev deps
        run: |
          yarn install

      - name: Lint
        run: |
          yarn lint

      - name: Install EdgeDB
        uses: edgedb/setup-edgedb@v1
        with:
          server-version: ${{ matrix.edgedb-version }}

      - name: Run functional tests
        run: |
          yarn test

  # This job exists solely to act as the test job aggregate to be
  # targeted by branch policies.
  regression-tests:
    name: "Regression Tests"
    needs: [test]
    runs-on: ubuntu-latest
    steps:
      - run: echo OK

Add a test conclusion job to use in branch policies
workflows: Add a test conclusion job to use in branch policies
