Skip to content

Commit

Permalink
build(ci): migrate to GitHub Actions (#70)
Browse files Browse the repository at this point in the history
- make `test-ci` not run coverage, since that will be done by Actions
- rename `test:watch` to `test-watch` for consistency, since
  gulp-style script names (ie, using `:`) are deprecated
  • Loading branch information
LoneRifle authored Jun 14, 2021
1 parent 831530f commit 3aed8e8
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 21 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: ci
on:
push:
pull_request:
types: [opened, reopened]
jobs:
build:
name: build
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '10.x'
- name: Cache Node.js modules
uses: actions/cache@v2
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-node-
${{ runner.OS }}-
- run: npm ci
- run: npx lockfile-lint --type npm --path package-lock.json --validate-https --allowed-hosts npm
- run: npm run build
test:
name: test
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '10.x'
- name: Cache Node.js modules
uses: actions/cache@v2
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-node-
${{ runner.OS }}-
- run: npm ci
- run: npm run test-ci
- name: Submit test coverage to Coveralls
uses: coverallsapp/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
19 changes: 0 additions & 19 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"types": "./dist/index.d.ts",
"scripts": {
"test": "jest",
"test-ci": "jest --coverage && coveralls < coverage/lcov.info && rm -rf ./coverage",
"test:watch": "jest --watch",
"test-ci": "jest --coverage",
"test-watch": "jest --watch",
"build": "tsc",
"prepare": "npm run build"
},
Expand Down

0 comments on commit 3aed8e8

Please sign in to comment.