Skip to content

Commit 9482123

Browse files
authored
Merge pull request #133 from eexit/go-github-actions
Go Github actions!
2 parents 3b79492 + fdb225d commit 9482123

File tree

4 files changed

+71
-31
lines changed

4 files changed

+71
-31
lines changed

.github/workflows/release.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Release
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
test:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- uses: actions/setup-node@v2
13+
with:
14+
node-version: 14
15+
- run: npm install -g yarn
16+
- run: yarn
17+
- run: yarn run eslint
18+
- run: yarn global add mocha
19+
- run: yarn test
20+
21+
publish-npm:
22+
needs: test
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v2
26+
- uses: actions/setup-node@v2
27+
with:
28+
node-version: 14
29+
registry-url: https://registry.npmjs.org/
30+
- run: yarn install --frozen-lockfile
31+
- run: yarn publish
32+
env:
33+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/test.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
node-version: [12, 14]
15+
steps:
16+
- uses: actions/checkout@v2
17+
- name: Node.js ${{ matrix.node-version }}
18+
uses: actions/setup-node@v2
19+
with:
20+
node-version: ${{ matrix.node-version }}
21+
cache: 'npm'
22+
- run: npm install -g yarn
23+
- run: yarn
24+
- run: yarn run eslint
25+
- run: yarn global add mocha
26+
- name: Run yarn test
27+
if: ${{ !startsWith(matrix.node-version, '14') }}
28+
run: yarn test
29+
- name: Run yarn coverage
30+
if: ${{ startsWith(matrix.node-version, '14') }}
31+
uses: paambaati/codeclimate-action@v3.0.0
32+
env:
33+
CC_TEST_REPORTER_ID: 0d3707693eec3617898169fa9d7f91a86d5a98a252beb81bd9fe89009647a456
34+
with:
35+
coverageCommand: yarn coverage
36+
coverageLocations: ${{ github.workspace }}/coverage/lcov.info:lcov

.travis.yml

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

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@
3232
],
3333
"license": "ISC",
3434
"scripts": {
35-
"test": "nyc --reporter=lcov mocha tests/index",
35+
"test": "mocha tests/index",
36+
"coverage": "nyc --reporter=lcov mocha tests/index",
3637
"eslint": "$(npm bin)/eslint ."
3738
},
3839
"engines": {

0 commit comments

Comments
 (0)