Skip to content

Commit 02ff305

Browse files
author
Jonathan Ginsburg
committed
chore(build): configure CI/CD with GitHub actions
Fixes #454
1 parent e5af8dc commit 02ff305

File tree

4 files changed

+98
-23
lines changed

4 files changed

+98
-23
lines changed

.github/workflows/release.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
main:
10+
name: Test and Release
11+
runs-on: ubuntu-latest
12+
env:
13+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
14+
GITHUB_TOKEN: ${{ secrets.KARMARUNNERBOT_GITHUB_TOKEN }}
15+
steps:
16+
- uses: actions/checkout@v2
17+
with:
18+
token: ${{ env.GITHUB_TOKEN }}
19+
fetch-depth: 0
20+
- uses: actions/setup-node@v2
21+
with:
22+
node-version: 12
23+
cache: npm
24+
- run: npm ci
25+
- run: |
26+
npm run commitlint -- \
27+
--verbose \
28+
--from `git merge-base origin/master $GITHUB_SHA`
29+
- run: npm run lint
30+
- run: npm run test
31+
- run: npm run release

.github/workflows/test.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches-ignore:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
11+
jobs:
12+
linux:
13+
name: "Node ${{ matrix.node }} on Linux: Test and Lint"
14+
runs-on: ubuntu-latest
15+
env:
16+
DISPLAY: ":0"
17+
strategy:
18+
matrix:
19+
node:
20+
- 10
21+
- 12
22+
steps:
23+
- uses: actions/checkout@v2
24+
with:
25+
fetch-depth: 0
26+
- uses: actions/setup-node@v2
27+
with:
28+
node-version: ${{ matrix.node }}
29+
cache: npm
30+
- uses: browser-actions/setup-firefox@latest
31+
with:
32+
firefox-version: "latest"
33+
- run: |
34+
sudo apt-get install xvfb && \
35+
Xvfb $DISPLAY &> /dev/null &
36+
- run: npm ci
37+
- run: |
38+
npm run commitlint -- \
39+
--verbose \
40+
--from `git merge-base origin/master $GITHUB_SHA`
41+
- run: npm run lint
42+
- run: npm run test
43+
- run: npm run examples
44+
windows:
45+
name: "Node ${{ matrix.node }} on Windows: Test and Lint"
46+
runs-on: windows-latest
47+
defaults:
48+
run:
49+
shell: bash
50+
strategy:
51+
matrix:
52+
node:
53+
- 10
54+
- 12
55+
steps:
56+
- uses: actions/checkout@v2
57+
- uses: actions/setup-node@v2
58+
with:
59+
node-version: ${{ matrix.node }}
60+
cache: npm
61+
- run: npm ci
62+
- run: npm run test
63+
- run: npm run examples

.travis.yml

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

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
"test": "mocha",
99
"update-contributors": "grunt contributors",
1010
"examples": "grunt karma",
11-
"semantic-release": "semantic-release"
11+
"semantic-release": "semantic-release",
12+
"release": "npm run update-contributors && semantic-release",
13+
"commitlint": "commitlint"
1214
},
1315
"repository": {
1416
"type": "git",
@@ -149,4 +151,4 @@
149151
"Petar Manev <petar.manev2010@gmail.com>",
150152
"Robin Böhm <robinboehm@googlemail.com>"
151153
]
152-
}
154+
}

0 commit comments

Comments
 (0)