Skip to content

Commit

Permalink
[Tests] migrate tests to Github Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Dec 27, 2020
1 parent 7e158e3 commit 6b19aa5
Show file tree
Hide file tree
Showing 2 changed files with 121 additions and 0 deletions.
81 changes: 81 additions & 0 deletions .github/workflows/node-4+.yml
@@ -0,0 +1,81 @@
name: 'Tests: node.js'

on: [pull_request, push]

jobs:
matrix:
runs-on: ubuntu-latest
outputs:
latest: ${{ steps.set-matrix.outputs.requireds }}
steps:
- uses: ljharb/actions/node/matrix@main
id: set-matrix
with:
versionsAsRoot: true
type: 'majors'
preset: '>=4'

latest:
needs: [matrix]
name: 'latest majors'
runs-on: ubuntu-latest

strategy:
matrix:
node-version: ${{ fromJson(needs.matrix.outputs.latest) }}
eslint:
- 7
- 6
- 5
- 4
- 3
exclude:
- node-version: 9
eslint: 7
- node-version: 8
eslint: 7
- node-version: 7
eslint: 7
- node-version: 7
eslint: 6
- node-version: 6
eslint: 7
- node-version: 6
eslint: 6
- node-version: 5
eslint: 7
- node-version: 5
eslint: 6
- node-version: 5
eslint: 5
- node-version: 5
eslint: 4
- node-version: 5 # TODO: fix
eslint: 3
- node-version: 4
eslint: 7
- node-version: 4
eslint: 6
- node-version: 4
eslint: 5
- node-version: 4 # TODO: fix
eslint: 4
- node-version: 4 # TODO: fix
eslint: 3

steps:
- uses: actions/checkout@v2
- uses: ljharb/actions/node/run@main
name: 'npm install && npm run tests-only'
with:
after_install: npm uninstall --no-save eslint-config-airbnb-base && npm install --no-save "eslint@${{ matrix.eslint }}"
node-version: ${{ matrix.node-version }}
command: 'test:ci'
skip-ls-check: true

node:
name: 'node 4+'
needs: [latest]
runs-on: ubuntu-latest
steps:
- run: 'echo tests completed'
40 changes: 40 additions & 0 deletions .github/workflows/node-pretest.yml
@@ -0,0 +1,40 @@
name: 'Tests: pretest/posttest'

on: [pull_request, push]

jobs:
lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: ljharb/actions/node/run@main
name: 'npm install && npm run lint'
with:
node-version: 'lts/*'
command: 'lint'
skip-ls-check: true

flow:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: ljharb/actions/node/run@main
name: 'npm install && npm run flow'
with:
node-version: 'lts/*'
command: 'flow'
skip-ls-check: true

posttest:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: ljharb/actions/node/run@main
name: 'npm install && npm run posttest'
with:
node-version: 'lts/*'
command: 'posttest'
skip-ls-check: true

0 comments on commit 6b19aa5

Please sign in to comment.