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 23, 2020
1 parent ef839f7 commit 8ef839a
Show file tree
Hide file tree
Showing 4 changed files with 103 additions and 54 deletions.
2 changes: 1 addition & 1 deletion .eslintignore
@@ -1 +1 @@
coverage
coverage/
74 changes: 74 additions & 0 deletions .github/workflows/node-4+.yml
@@ -0,0 +1,74 @@
name: 'Tests: node.js'

on: [pull_request, push]

jobs:
matrix:
runs-on: ubuntu-latest
outputs:
latest: ${{ steps.set-matrix.outputs.requireds }}
minors: ${{ steps.set-matrix.outputs.optionals }}
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
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: 4
eslint: 7
- node-version: 4
eslint: 6
- node-version: 4
eslint: 5

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

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

on: [pull_request, push]

jobs:
pretest:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: ljharb/actions/node/run@main
name: 'npm install && npm run pretest'
with:
node-version: 'lts/*'
command: 'pretest'
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
53 changes: 0 additions & 53 deletions .travis.yml

This file was deleted.

0 comments on commit 8ef839a

Please sign in to comment.