Skip to content

Commit

Permalink
Add a GitHub action for CI (#147)
Browse files Browse the repository at this point in the history
  • Loading branch information
koddsson authored Sep 26, 2021
1 parent e64c9dc commit 4415ced
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 80 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Build

on:
pull_request:
push:
branches:
- master

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Get sources
uses: actions/checkout@v1

- name: Restore npm cache
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-modules-
- name: Use Node.js 14
uses: actions/setup-node@v2
with:
node-version: '14'

- name: Install dependencies
run: npm install

- name: Build
run: npm run build

- name: Test
run: npm run test
env:
CI: true
71 changes: 0 additions & 71 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
src="https://img.shields.io/npm/v/type-detect.svg?style=flat-square"
/>
</a>
<a href="https://travis-ci.org/chaijs/type-detect">
<a href="https://github.com/chaijs/type-detect">
<img
alt="build:?"
src="https://img.shields.io/travis/chaijs/type-detect/master.svg?style=flat-square"
src="https://github.com/chaijs/type-detect/workflows/Build/badge.svg"
/>
</a>
<a href="https://coveralls.io/r/chaijs/type-detect">
Expand Down
8 changes: 1 addition & 7 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if (process.env.SAUCE_USERNAME) {
startConnect = true;
} else if (process.env.APPVEYOR) {
browsers = [ 'Firefox', 'ChromeHeadless', 'IE' ];
} else if (process.env.TRAVIS) {
} else if (process.env.CI) {
browsers = [ 'FirefoxHeadless', 'ChromeHeadlessNoSandbox' ];
} else if (!process.env.KARMA_MANUAL) {
browsers = [];
Expand All @@ -28,12 +28,6 @@ if (process.env.APPVEYOR) {
branch = process.env.APPVEYOR_REPO_BRANCH;
build = `appveyor@${ process.env.APPVEYOR_JOB_NUMBER }`;
job = process.env.APPVEYOR_JOB_NUMBER;
} else if (process.env.TRAVIS) {
branch = process.env.TRAVIS_BRANCH;
build = `travis@${ process.env.TRAVIS_JOB_NUMBER }`;
job = process.env.TRAVIS_JOB_NUMBER;
// Travis has its own saucelabs connect process, so ensure karma won't run it
startConnect = false;
}
/* eslint-enable */

Expand Down

0 comments on commit 4415ced

Please sign in to comment.