Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CI/CD with GitHub Actions #306

Merged
merged 18 commits into from
Mar 30, 2022
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
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@v3
with:
token: ${{ env.GITHUB_TOKEN }}
fetch-depth: 0
- uses: browser-actions/setup-firefox@latest
- uses: actions/setup-node@v3
with:
node-version: 12
cache: npm
- run: npm ci
- run: npm run test
- run: npm run release
50 changes: 50 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Test

on:
pull_request:
branches:
- master

jobs:
linux:
name: "Node ${{ matrix.node }} on Linux: Test and Lint"
runs-on: ubuntu-latest
strategy:
matrix:
jginsburgn marked this conversation as resolved.
Show resolved Hide resolved
node:
- 10
- 12
jginsburgn marked this conversation as resolved.
Show resolved Hide resolved
- 14
- 16
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: browser-actions/setup-firefox@latest
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: npm
- run: npm ci
- run: npm run test
windows:
name: "Node ${{ matrix.node }} on Windows: Test and Lint"
runs-on: windows-latest
defaults:
run:
shell: bash
strategy:
matrix:
node:
- 10
- 12
- 14
- 16
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: npm
- run: npm ci
- run: npm run test
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ node_modules/
tmp/
lib/adapter.js
integration-tests/
.DS_Store
24 changes: 0 additions & 24 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion commitlint.config.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = {extends: ['@commitlint/config-conventional']}
module.exports = { extends: ['@commitlint/config-angular'] }
3 changes: 1 addition & 2 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@ module.exports = function (config) {
'test/*.js'
],

browsers: process.env.TRAVIS ? ['Firefox'] : ['Chrome'],
browsers: ['FirefoxHeadless'],

autoWatch: true,

plugins: [
'karma-firefox-launcher',
'karma-chrome-launcher',
require.resolve('./')
]
})
Expand Down
25 changes: 11 additions & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"lib/*.js"
],
"scripts": {
"test": "jasmine && grunt"
"test": "jasmine && grunt",
"release": "grunt release"
},
"repository": {
"type": "git",
Expand All @@ -24,7 +25,7 @@
},
"devDependencies": {
"@commitlint/cli": "^9.1.1",
"@commitlint/config-conventional": "^9.1.1",
"@commitlint/config-angular": "^12.1.4",
"conventional-changelog": "^3.1.21",
"conventional-changelog-core": "^4.1.7",
"eslint-config-standard": "^14.1.1",
Expand All @@ -42,7 +43,6 @@
"husky": "^4.2.5",
"jasmine": "^3.6.1",
"karma": "^4.4.1",
"karma-chrome-launcher": "^3.1.0",
"karma-firefox-launcher": "^1.3.0",
"load-grunt-tasks": "^5.1.0"
},
Expand Down
2 changes: 2 additions & 0 deletions integration-tests.sh → tools/integration-tests.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env bash
set -xve
PKG_FILE="$PWD/$(npm pack)"
git clone https://github.com/karma-runner/integration-tests.git --depth 1
cd integration-tests
Expand Down