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 authored and Nathan H. Leung committed Apr 6, 2021
1 parent 80f587b commit 41c214a
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 26 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/node-pretest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: 'Tests: pretest/posttest'

on: [pull_request, push]

jobs:
pretest:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: ljharb/actions/node/install@main
name: 'nvm install lts/* && npm install'
with:
node-version: 'lts/*'
- run: npm run pretest

posttest:
if: 'false'
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: ljharb/actions/node/install@main
name: 'nvm install lts/* && npm install'
with:
node-version: 'lts/*'
- run: npm run posttest
41 changes: 41 additions & 0 deletions .github/workflows/node.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
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:
preset: '>=8'
type: 'majors'

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

strategy:
fail-fast: false
matrix: ${{ fromJson(needs.matrix.outputs.latest) }}

steps:
- uses: actions/checkout@v2
- uses: ljharb/actions/node/install@main
name: 'nvm install ${{ matrix.node-version }} && npm install'
with:
node-version: ${{ matrix.node-version }}
before_install: npm install -g pnpm@3 yarn@1
- run: npm run tests-only

node:
name: 'node 8+'
needs: [latest]
runs-on: ubuntu-latest
steps:
- run: 'echo tests completed'
21 changes: 0 additions & 21 deletions .travis.yml

This file was deleted.

10 changes: 5 additions & 5 deletions fixtures/pnpm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
"license": "MIT",
"private": true,
"dependencies": {
"eslint": "6.1.0",
"eslint-config-airbnb": "18.0.1",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-jsx-a11y": "^6.2.3",
"eslint-plugin-react": "^7.14.3",
"eslint": "^7.2.0",
"eslint-config-airbnb": "18.2.1",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-react": "^7.21.5",
"eslint-plugin-react-hooks": "^1.7.0"
}
}

0 comments on commit 41c214a

Please sign in to comment.