Skip to content
This repository was archived by the owner on Dec 24, 2020. It is now read-only.

Commit 826f494

Browse files
authored
add GH action for tests & prettier (#5)
1 parent e064c6c commit 826f494

File tree

4 files changed

+72
-3
lines changed

4 files changed

+72
-3
lines changed

.github/workflows/lint.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Linters
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- '*'
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
if: "!contains(github.event.head_commit.message, '[ci skip]')"
15+
steps:
16+
- uses: actions/checkout@v2
17+
- name: Use Node.js 12.x
18+
uses: actions/setup-node@v1
19+
with:
20+
node-version: '12.x'
21+
- run: npm install -g yarn
22+
- name: Get yarn cache
23+
id: yarn-cache
24+
run: echo "::set-output name=dir::$(yarn cache dir)"
25+
- uses: actions/cache@v1
26+
with:
27+
path: ${{ steps.yarn-cache.outputs.dir }}
28+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
29+
restore-keys: |
30+
${{ runner.os }}-yarn-
31+
- name: yarn install and test
32+
run: |
33+
yarn install
34+
yarn format:check

.github/workflows/test.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- '*'
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
strategy:
15+
matrix:
16+
node-version: [8.x, 10.x, 12.x]
17+
if: "!contains(github.event.head_commit.message, '[ci skip]')"
18+
steps:
19+
- uses: actions/checkout@v2
20+
- name: Use Node.js ${{ matrix.node-version }}
21+
uses: actions/setup-node@v1
22+
with:
23+
node-version: ${{ matrix.node-version }}
24+
- run: npm install -g yarn
25+
- name: Get yarn cache
26+
id: yarn-cache
27+
run: echo "::set-output name=dir::$(yarn cache dir)"
28+
- uses: actions/cache@v1
29+
with:
30+
path: ${{ steps.yarn-cache.outputs.dir }}
31+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
32+
restore-keys: |
33+
${{ runner.os }}-yarn-
34+
- name: yarn install and test
35+
run: |
36+
yarn install
37+
yarn test

.travis.yml

Lines changed: 0 additions & 3 deletions
This file was deleted.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"predeploy": "cd example && yarn install && yarn run build",
2222
"deploy": "gh-pages -d example/build",
2323
"format": "prettier --write \"src/**/*\"",
24+
"format:check": "prettier --check \"src/**/*\"",
2425
"contributors:add": "all-contributors add",
2526
"contributors:generate": "all-contributors generate"
2627
},

0 commit comments

Comments
 (0)