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 #249

Merged
merged 13 commits into from
Mar 4, 2022
25 changes: 25 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Release

on:
push:
branches:
- master

jobs:
main:
name: Test, Tag Commit and Release to NPM
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 }}
- uses: actions/setup-node@v2
with:
cache: npm
- run: npm ci
- run: npm run lint
- 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:
node:
- 10
- 12
jginsburgn marked this conversation as resolved.
Show resolved Hide resolved
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
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
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules
.DS_Store
1 change: 0 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
.*

Gruntfile.coffee
CONTRIBUTING.md
16 changes: 0 additions & 16 deletions .travis.yml

This file was deleted.

52 changes: 52 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,55 @@
Please see the [Contributing to Karma] guide for information on contributing to this project.

[Contributing to Karma]: https://github.com/karma-runner/karma/blob/master/CONTRIBUTING.md

# Pull Requests

Before filing a PR, ensure that:

* [ ] Tests pass.
* [ ] Linting passes.
* [ ] Commit linting passes.

See more details in each subsection below.

## Testing

To run unit tests execute:

```bash
npm run unit-test
```

To run integration tests execute:

```bash
npm run integration-test
```

Tip: you can run both unit and integration tests in a single step via: `npm test`.

## Linting

To lint your contribution execute:

```bash
npm run lint
```

There are some lint problems that can be auto-fixed for you. Try the following command to trigger auto-fix:

```bash
npm run lint --fix
```

## Commit Linting

We enforce [Angular's Commit Message Format] in our commit history. To verify that your commits are syntactically correct, execute:

```bash
npm run commitlint -- \
--verbose \
--from `git merge-base origin/master HEAD`
```

[Angular's Commit Message Format]: https://github.com/angular/angular/blob/master/CONTRIBUTING.md#commit
1 change: 1 addition & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = { extends: ['@commitlint/config-angular'] }
80 changes: 0 additions & 80 deletions gruntfile.js

This file was deleted.

Loading