Skip to content

Commit

Permalink
feat: switch from travis to github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleRoss committed Apr 9, 2021
1 parent 11caad6 commit f2d418e
Show file tree
Hide file tree
Showing 3 changed files with 120 additions and 30 deletions.
99 changes: 99 additions & 0 deletions .github/workflows/module.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
name: module
on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
test:
strategy:
matrix:
node: [ '10', '12', '14' ]
name: test/node v${{ matrix.node }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- name: Setup Node v${{ matrix.node }}
uses: actions/setup-node@master
with:
node-version: ${{ matrix.node }}
- name: Install Dependencies
run: npm ci
- name: Run Tests
run: npm test

coverage:
name: Code Coverage
needs: [ test ]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- name: Setup Node
uses: actions/setup-node@master
with:
node-version: 14
- name: Install Dependencies
run: npm ci
- name: Run Tests
if: ${{ github.event_name == 'pull_request' }}
run: npm test
- name: Comment Coverage on PR
if: ${{ github.event_name == 'pull_request' }}
uses: artiomtr/jest-coverage-report-action@v1.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
threshold: 100
- name: Upload Coverage to Code Climate
uses: paambaati/codeclimate-action@v2.7.2
if: ${{ github.event_name == 'push' }}
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
with:
coverageCommand: npm test
coverageLocations: |
${{ github.workspace }}/coverage/lcov.info:lcov
eslint:
name: ESLint Check
runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request' }}
steps:
- name: Checkout
uses: actions/checkout@master
- name: Setup Node
uses: actions/setup-node@master
with:
node-version: 14
- name: Install Dependencies
run: npm ci
- uses: bradennapier/eslint-plus-action@v3.4.2
with:
includeGlob:
- 'index.js'
- 'index.test.js'
- 'lib/*.js'

release:
name: Release
if: ${{ github.event_name == 'push' }}
needs: [ test, coverage ]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- name: Setup Node
uses: actions/setup-node@master
with:
node-version: 14
- name: Install Dependencies
run: npm ci
- name: Publish to NPM
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release
21 changes: 21 additions & 0 deletions .github/workflows/site.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: site
on:
push:
branches:
- master
tags:
- '!*'

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- name: Build and Deploy Site
uses: enriikke/gatsby-gh-pages-action@bf3ba06696b02a028d2121b04961926c1b862a3c
with:
access-token: ${{ secrets.ACCESS_TOKEN }}
deploy-branch: gh-pages
gatsby-args: --prefix-paths
working-dir: ${{ github.workspace }}/site
30 changes: 0 additions & 30 deletions .travis.yml

This file was deleted.

0 comments on commit f2d418e

Please sign in to comment.