Skip to content

Commit

Permalink
chore(build): configure CI/CD with GitHub actions
Browse files Browse the repository at this point in the history
Fixes #454
  • Loading branch information
Jonathan Ginsburg committed Dec 1, 2021
1 parent e5af8dc commit 02ff305
Show file tree
Hide file tree
Showing 4 changed files with 98 additions and 23 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Release

on:
push:
branches:
- master

jobs:
main:
name: Test and Release
runs-on: ubuntu-latest
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.KARMARUNNERBOT_GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
with:
token: ${{ env.GITHUB_TOKEN }}
fetch-depth: 0
- uses: actions/setup-node@v2
with:
node-version: 12
cache: npm
- run: npm ci
- run: |
npm run commitlint -- \
--verbose \
--from `git merge-base origin/master $GITHUB_SHA`
- run: npm run lint
- run: npm run test
- run: npm run release
63 changes: 63 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Test

on:
push:
branches-ignore:
- master
pull_request:
branches:
- master

jobs:
linux:
name: "Node ${{ matrix.node }} on Linux: Test and Lint"
runs-on: ubuntu-latest
env:
DISPLAY: ":0"
strategy:
matrix:
node:
- 10
- 12
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
cache: npm
- uses: browser-actions/setup-firefox@latest
with:
firefox-version: "latest"
- run: |
sudo apt-get install xvfb && \
Xvfb $DISPLAY &> /dev/null &
- run: npm ci
- run: |
npm run commitlint -- \
--verbose \
--from `git merge-base origin/master $GITHUB_SHA`
- run: npm run lint
- run: npm run test
- run: npm run examples
windows:
name: "Node ${{ matrix.node }} on Windows: Test and Lint"
runs-on: windows-latest
defaults:
run:
shell: bash
strategy:
matrix:
node:
- 10
- 12
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
cache: npm
- run: npm ci
- run: npm run test
- run: npm run examples
21 changes: 0 additions & 21 deletions .travis.yml

This file was deleted.

6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
"test": "mocha",
"update-contributors": "grunt contributors",
"examples": "grunt karma",
"semantic-release": "semantic-release"
"semantic-release": "semantic-release",
"release": "npm run update-contributors && semantic-release",
"commitlint": "commitlint"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -149,4 +151,4 @@
"Petar Manev <petar.manev2010@gmail.com>",
"Robin Böhm <robinboehm@googlemail.com>"
]
}
}

0 comments on commit 02ff305

Please sign in to comment.