Skip to content

Commit f8525e7

Browse files
committed
build: Set up GitHub Actions
1 parent c4b0aa5 commit f8525e7

File tree

8 files changed

+4495
-28
lines changed

8 files changed

+4495
-28
lines changed

Diff for: .github/workflows/CI.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: CI
2+
on:
3+
- push
4+
- pull_request
5+
6+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
7+
jobs:
8+
9+
tests:
10+
# Packages 'firefox' and 'chromium' are pre-installed.
11+
#
12+
# https://github.com/actions/virtual-environments/blob/ubuntu20/20210302.0/images/linux/Ubuntu2004-README.md
13+
runs-on: ubuntu-20.04
14+
strategy:
15+
matrix:
16+
node-version: [10.x, 12.x, 14.x]
17+
steps:
18+
# Clone the repo and checkout the commit for which the workflow was triggered
19+
- uses: actions/checkout@v2
20+
21+
- name: Install Node.js
22+
uses: actions/setup-node@v2
23+
with:
24+
node-version: ${{ matrix.node-version }}
25+
26+
- name: Install dependencies
27+
run: npm ci
28+
29+
- name: Run tests
30+
run: npm test

Diff for: .github/workflows/Coverage.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Coverage
2+
on:
3+
- push
4+
5+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
6+
jobs:
7+
8+
coveralls:
9+
# Packages 'firefox' and 'chromium' are pre-installed.
10+
#
11+
# https://github.com/actions/virtual-environments/blob/ubuntu20/20210302.0/images/linux/Ubuntu2004-README.md
12+
runs-on: ubuntu-20.04
13+
steps:
14+
# Clone the repo and checkout the commit for which the workflow was triggered
15+
- uses: actions/checkout@v2
16+
17+
- name: Install Node.js
18+
uses: actions/setup-node@v2
19+
with:
20+
node-version: 14.x
21+
22+
- name: Install dependencies
23+
run: npm ci
24+
25+
- name: Coveralls
26+
run: npm run coveralls
27+
env:
28+
COVERALLS_REPO_TOKEN: "${{ secrets.COVERALLS_REPO_TOKEN }}"
29+
COVERALLS_GIT_BRANCH: "${{ github.ref }}"

Diff for: .gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,3 @@
22
/coverage
33
/node_modules
44
/npm-debug.log
5-
/package-lock.json

Diff for: .travis.yml

-15
This file was deleted.

Diff for: README.md

+7-10
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
[![Build Status](https://travis-ci.com/Krinkle/travis-ci-node-and-browser-qunit.svg?branch=main)](https://travis-ci.com/github/Krinkle/travis-ci-node-and-browser-qunit) [![Coverage Status](https://coveralls.io/repos/github/Krinkle/travis-ci-node-and-browser-qunit/badge.svg?branch=main)](https://coveralls.io/github/Krinkle/travis-ci-node-and-browser-qunit?branch=main) [![Tested with QUnit](https://img.shields.io/badge/tested_with-qunit-9c3493.svg)](https://qunitjs.com/)
1+
[![Build Status](https://github.com/Krinkle/example-node-and-browser-qunit-ci/actions/workflows/CI.yml/badge.svg?event=push)](https://github.com/Krinkle/example-node-and-browser-qunit-ci/actions/workflows/CI.yml)
2+
[![Coverage Status](https://coveralls.io/repos/github/Krinkle/example-node-and-browser-qunit-ci/badge.svg?branch=main)](https://coveralls.io/github/Krinkle/example-node-and-browser-qunit-ci?branch=main)
3+
[![Tested with QUnit](https://img.shields.io/badge/tested_with-qunit-9c3493.svg)](https://qunitjs.com/)
24

35
# Run QUnit on the web and in Node.js!
46

@@ -11,19 +13,14 @@ on Node.js, plus (combined) code coverage reports.
1113
Clone or fork this repository and be sure to run the following two commands to
1214
install the development dependencies and kick off your first test run:
1315

14-
<pre lang="bash">
15-
npm install
16+
```
17+
npm ci
1618
npm test
17-
</pre>
19+
```
1820

1921
## Tell me more
2022

21-
[Travis CI](https://travis-ci.com/) provides cloud-based [Continuous integration](https://en.wikipedia.org/wiki/Continuous_integration) for open source projects on GitHub. After you enable it, Travis automatically runs the tests and reports back whenever you `git push`, or submit a pull-request.
22-
23-
This boilerplate repository has Travis enabled ([view build history](https://travis-ci.com/github/Krinkle/travis-ci-node-and-browser-qunit)).
24-
25-
Take a look around, you'll get the hang of it, it's easy!
26-
If you've got any questions or problems, feel free to [file an issue](https://github.com/Krinkle/travis-ci-node-and-browser-qunit/issues).
23+
If you've got any questions, feel free to file an issue.
2724

2825
* [@Krinkle](https://github.com/Krinkle) ([Twitter](https://twitter.com/TimoTijhof))
2926
* [@keithamus](https://github.com/keithamus) ([Twitter](https://twitter.com/keithamus))

Diff for: karma.conf.js

+10-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,16 @@
22

33
module.exports = function (config) {
44
config.set({
5-
browsers: ['FirefoxHeadless'],
5+
browsers: [
6+
'FirefoxHeadless',
7+
// Consider Chromium and Google Chrome to be similar enough.
8+
// Pick whichever is most likely to be locally installed and kept up-to-date
9+
// (Chromium on Linux, Chrome on macOS/Windows).
10+
// You can override this via CHROME_BIN or CHROMIUM_BIN.
11+
// For example, if your OS defaults to Chrome but you prefer Chromium,
12+
// then set something like CHROME_BIN=/usr/bin/chromium.
13+
(process.platform === 'linux') ? 'ChromiumHeadless' : 'ChromeHeadless'
14+
],
615
frameworks: ['qunit'],
716
files: [
817
'src/MyLib.js',

0 commit comments

Comments
 (0)