Skip to content

Commit a511f92

Browse files
committed
Replace Travis with GitHub action
1 parent 22572ac commit a511f92

File tree

2 files changed

+47
-12
lines changed

2 files changed

+47
-12
lines changed

.github/workflows/test.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: 🧪 Test
2+
3+
on:
4+
push:
5+
branches:
6+
- "master"
7+
pull_request: {}
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
if: "!contains(github.event.head_commit.message, '[skip ci]')"
13+
14+
strategy:
15+
matrix:
16+
node-version: [10.x, 12.x, 14.x, 16.x]
17+
18+
steps:
19+
- name: 🛑 Cancel Previous Runs
20+
uses: styfle/cancel-workflow-action@a40b8845c0683271d9f53dfcb887a7e181d3918b # [email protected]
21+
- name: ⬇️ Checkout repo
22+
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # pin@v2
23+
- name: ⎔ Setup node ${{ matrix.node-version }}
24+
uses: actions/setup-node@25316bbc1f10ac9d8798711f44914b1cf3c4e954 # pin@v2
25+
with:
26+
node-version: ${{ matrix.node-version }}
27+
cache: "npm"
28+
- name: 🗄 Cache node_modules
29+
id: cache-node_modules
30+
uses: actions/cache@c64c572235d810460d0d6876e9c705ad5002b353 # pin@v2
31+
with:
32+
path: "**/node_modules"
33+
key: node_modules-${{ runner.os }}-node-${{ matrix.node-version }}-${{
34+
hashFiles('**/package-lock.json') }}
35+
- name: 📥 Install dependencies
36+
if: steps.cache-node_modules.outputs.cache-hit != 'true'
37+
run: |
38+
npm ci --ignore-scripts
39+
- name: 🧪 Test
40+
run: |
41+
npm test
42+
env:
43+
CI: true
44+
- name: ⬆️ Upload coverage report
45+
uses: coverallsapp/github-action@9ba913c152ae4be1327bfb9085dc806cedb44057 # [email protected]
46+
with:
47+
github-token: ${{ secrets.GITHUB_TOKEN }}

.travis.yml

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)