Skip to content

Commit

Permalink
[Tests] migrate from travis to github actions
Browse files Browse the repository at this point in the history
Co-authored-by: Paul Mineev <pmineev@blend.com>
Co-authored-by: Jordan Harband <ljharb@gmail.com>
  • Loading branch information
Paul Mineev and ljharb committed Sep 14, 2022
1 parent e37c29b commit 63611b5
Show file tree
Hide file tree
Showing 6 changed files with 96 additions and 33 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/node-pretest.yml
@@ -0,0 +1,26 @@
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:
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
36 changes: 36 additions & 0 deletions .github/workflows/node.yml
@@ -0,0 +1,36 @@
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: '10.13 || >=10.13'

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

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

steps:
- uses: actions/checkout@v3
- uses: ljharb/actions/node/install@main
name: 'nvm install ${{ matrix.node-version }} && npm install'
with:
node-version: ${{ matrix.node-version }}
skip-ls-check: true
- run: npm run tests-only
- uses: codecov/codecov-action@v1
15 changes: 15 additions & 0 deletions .github/workflows/rebase.yml
@@ -0,0 +1,15 @@
name: Automatic Rebase

on: [pull_request_target]

jobs:
_:
name: "Automatic Rebase"

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: ljharb/rebase@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
12 changes: 12 additions & 0 deletions .github/workflows/require-allow-edits.yml
@@ -0,0 +1,12 @@
name: Require “Allow Edits”

on: [pull_request_target]

jobs:
_:
name: "Require “Allow Edits”"

runs-on: ubuntu-latest

steps:
- uses: ljharb/require-allow-edits@main
28 changes: 0 additions & 28 deletions .travis.yml

This file was deleted.

12 changes: 7 additions & 5 deletions package.json
Expand Up @@ -4,13 +4,14 @@
"description": "A babel plugin that optimizes and inlines SVGs for your react components.",
"main": "lib/index.js",
"scripts": {
"test": "npm run tests-only",
"prepublish": "npm run build",
"pretest": "npm run lint",
"lint": "eslint src/",
"pretests-only": "npm run build",
"tests-only": "babel-node test/sanity.js",
"build": "babel src --out-dir lib",
"lint": "eslint src/",
"prepublish": "npm run build",
"pretest": "npm run lint"
"test": "npm run tests-only",
"tests-only": "babel-node test/sanity.js",
"posttest": "aud --production"
},
"repository": {
"type": "git",
Expand All @@ -34,6 +35,7 @@
"@babel/core": "^7.0.0",
"@babel/node": "^7.12.16",
"@babel/preset-react": "^7.12.13",
"aud": "^2.0.0",
"babel-preset-airbnb": "^3.3.2",
"eslint": "^7.20.0",
"eslint-config-airbnb": "^18.2.1",
Expand Down

0 comments on commit 63611b5

Please sign in to comment.