Skip to content

Commit

Permalink
Move to Github actions (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-veit authored Feb 25, 2021
1 parent faaf632 commit 6f8f213
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 49 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Node.js CI

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [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 }}
- run: sudo apt-get install xvfb
- run: npm ci
- run: npm run build --if-present
- run: xvfb-run --auto-servernum npm run test
env:
CI: true
39 changes: 39 additions & 0 deletions .github/workflows/npmpublish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages

name: Node.js Package

on:
push:
tags:
- "v*"

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12
- run: sudo apt-get install xvfb
- run: npm ci
- run: npm run build --if-present
- run: xvfb-run --auto-servernum npm run test
env:
CI: true

publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm run prerelease
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
45 changes: 0 additions & 45 deletions .travis.yml

This file was deleted.

7 changes: 4 additions & 3 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,15 @@ module.exports = function(config) {
singleRun: false,
concurrency: 1, // because we use server-side
customLaunchers: {
Chrome_travis_ci: {
Chrome_ci: {
base: 'Chrome',
flags: ['--no-sandbox'],
},
},
});

if (process.env.TRAVIS) {
config.browsers = ['Chrome_travis_ci'];
if (process.env.GITHUB_ACTIONS) {
config.browsers = ['Chrome_ci'];
config.singleRun = true;
}
};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"build": "npm run build-es && NODE_ENV=production ./node_modules/webpack/bin/webpack.js --mode production",
"build-debug": "NODE_ENV=development; ./node_modules/webpack/bin/webpack.js --mode=development",
"start": "./node_modules/webpack-dev-server/bin/webpack-dev-server.js --mode development --open",
"test-watch": "NODE_ENV=development; npm run build-debug && ./node_modules/karma/bin/karma start karma.conf.js",
"test": "NODE_ENV=development; npm run build-debug && ./node_modules/karma/bin/karma start karma.conf.js",
"prerelease": "rm -rf dist/*; npm run build; zip -r dist.zip dist"
},
"dependencies": {
Expand Down

0 comments on commit 6f8f213

Please sign in to comment.