diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 75ece6855968..60a4c64e0023 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -9,6 +9,14 @@ on: - '**' jobs: + cleanup-runs: + runs-on: ubuntu-latest + steps: + - uses: rokroskar/workflow-run-cleanup-action@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/master'" + lint-and-typecheck: name: Running TypeScript compiler & ESLint runs-on: ubuntu-latest @@ -41,3 +49,35 @@ jobs: run: yarn lint:prettier:ci - name: check copyright headers run: yarn check-copyright-headers + test: + name: Node v${{ matrix.node-version }} on ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + # https://github.com/actions/setup-node/issues/27 + node-version: [8.17.0, 10.x, 12.x, 13.x] + # Windows tests are failing for whatever reason, so just do linux and mac for now + os: [ubuntu-latest, macOS-latest] + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v2 + - name: Get yarn cache + 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 }}-node-${{ matrix.node-version }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-node-${{ matrix.node-version }}-yarn- + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - name: install + run: yarn install-no-ts-build + - name: run tests + run: yarn test-ci-partial + env: + CI: true