Skip to content

Commit

Permalink
Replace travis by Github Action
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisBrunner committed Apr 29, 2020
1 parent c16481b commit 5c6d47f
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 24 deletions.
74 changes: 74 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Build

on: [push, pull_request]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [10.x, 12.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Check cache node_modules
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-node-${{ matrix.node-version }}-
- name: Install dependencies
run: npm install
- run: npm run ci:test
- run: npm run lint
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
flag-name: node-${{ matrix.node }}
parallel: true
- run: npm run build:examples
- name: Upload examples build
uses: actions/upload-artifact@v1
with:
name: Examples
path: examples

finish:
needs: build
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true

deploy:
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/master'

steps:
- name: Checkout
uses: actions/checkout@v2
with:
persist-credentials: false
- name: Download examples build
uses: actions/download-artifact@v1
with:
name: Snowflake
path: examples
- name: Deploy
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
access_token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages
folder: examples
clean: true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ node_modules
# Code coverage
/.nyc_output
/coverage
/examples/*.js
2 changes: 1 addition & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ npm-debug.log
.eslint*
.mocha.opts
.nycrc
.travis.yml
.github

# Code coverage
.nyc_output
Expand Down
20 changes: 0 additions & 20 deletions .travis.yml

This file was deleted.

4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
"lint": "eslint .",
"test": "jest --config jest.config.js",
"test:watch": "npm run test -- --watch",
"travis:test": "CI=yes npm run test",
"travis:coverage": "cat ./coverage/lcov.info | coveralls",
"ci:test": "CI=yes npm run test",
"start": "webpack-dev-server --config webpack/dev.js",
"prepush": "npm run lint && npm run test",
"prepare": "npm run clean && npm run lint && npm run build && npm run test",
Expand All @@ -32,7 +31,6 @@
"babel-jest": "^24.9.0",
"babel-loader": "^8.0.6",
"copy-webpack-plugin": "^5.0.4",
"coveralls": "^3.0.7",
"enzyme": "^3.10.0",
"enzyme-adapter-react-16": "^1.15.1",
"eslint": "^6.5.1",
Expand Down

0 comments on commit 5c6d47f

Please sign in to comment.