Skip to content

Commit

Permalink
Switch from travis to github actions for CI
Browse files Browse the repository at this point in the history
This also:
- adds "files" to package.json which removes a lot of dev files
  from the published package
- adds a package-lock.json file for 'npm ci' usage
  • Loading branch information
trentm committed Jun 28, 2020
1 parent 0df66f4 commit 86f0a56
Show file tree
Hide file tree
Showing 7 changed files with 3,035 additions and 33 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Check Lint/Style
on: [push, pull_request]
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '12.x'
- run: npm ci
- run: npm run check
57 changes: 57 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Test

on:
push:
paths-ignore:
- 'docs/**'
- '*.md'
pull_request:
- 'docs/**'
- '*.md'

jobs:
# Test once on every (available) plat, using LTS node version
# (https://nodejs.org/en/about/releases/).
test-plats:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '12.x'
- run: npm ci
- run: npm test

# Test once for every supported node version (don't repeat the LTS
# node version from the previous step). Only test on one
# platform to not overkill the number of builds.
test-vers:
strategy:
matrix:
node: ['8.x', '10.x', '14.x']
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- run: npm ci
- run: npm test

# Test older versions separately because really old node/npm don't support
# 'npm ci'.
test-old-vers:
strategy:
matrix:
node: ['0.10.x', '4.x', '6.x']
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- run: npm install
- run: npm test
24 changes: 0 additions & 24 deletions .travis.yml

This file was deleted.

6 changes: 2 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ NODEOPT ?= $(HOME)/opt
#---- Files

JSSTYLE_FILES := $(shell find lib test tools examples -name "*.js") bin/bunyan
# All test files *except* dtrace.test.js.
NON_DTRACE_TEST_FILES := $(shell ls -1 test/*.test.js | grep -v dtrace | xargs)


#---- Targets
Expand Down Expand Up @@ -95,8 +93,8 @@ test: $(NODEUNIT)
test -z "$(DTRACE_UP_IN_HERE)" || test -n "$(SKIP_DTRACE)" || \
(node -e 'require("dtrace-provider").createDTraceProvider("isthisthingon")' && \
echo "\nNote: Use 'SKIP_DTRACE=1 make test' to skip parts of the test suite that require root." && \
$(SUDO) $(NODEUNIT) test/dtrace.test.js)
$(NODEUNIT) $(NON_DTRACE_TEST_FILES)
$(SUDO) $(NODEUNIT) test/dtrace/*.test.js)
$(NODEUNIT) test/*.test.js

# Test with all node supported versions (presumes install locations I use on
# my machine -- "~/opt/node-VER"):
Expand Down
Loading

0 comments on commit 86f0a56

Please sign in to comment.