Skip to content

Commit b90b886

Browse files
authored
feat(test): move to using gh actions for testing (#194)
* feat(test): move to using gh actions for testing Signed-off-by: Matthew Peveler <[email protected]> * add publish workflow Signed-off-by: Matthew Peveler <[email protected]> * update test badge in README Signed-off-by: Matthew Peveler <[email protected]>
1 parent 41d082c commit b90b886

File tree

4 files changed

+65
-43
lines changed

4 files changed

+65
-43
lines changed

.github/workflows/publish.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Publish
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v1
12+
- uses: actions/setup-node@v1
13+
with:
14+
node-version: 12
15+
registry-url: https://registry.npmjs.org/
16+
17+
- run: npm ci
18+
- run: npm run build
19+
20+
- run: npm publish
21+
env:
22+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
23+
24+
- name: Upload binaries to release
25+
uses: svenstaro/upload-release-action@v2
26+
with:
27+
repo_token: ${{ secrets.GITHUB_TOKEN }}
28+
file: dist/pdf-annotate*.js*
29+
tag: ${{ github.ref }}
30+
overwrite: true
31+
file_glob: true

.github/workflows/test.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches: [ '*' ]
6+
pull_request:
7+
branches: [ '*' ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
node-version: [10.x, 12.x, 14.x]
16+
17+
steps:
18+
- uses: actions/checkout@v2
19+
20+
- name: Use Node.js ${{ matrix.node-version }}
21+
uses: actions/setup-node@v1
22+
with:
23+
node-version: ${{ matrix.node-version }}
24+
25+
- run: npm ci
26+
27+
- run: npm run lint
28+
- run: npm run build
29+
30+
# todo: figure out why firefox is failing
31+
- run: npm test -- --browsers ChromeHeadless
32+
33+
- uses: codecov/codecov-action@v1

.travis.yml

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

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# pdf-annotate.js
22

3-
[![Build Status](https://travis-ci.com/Submitty/pdf-annotate.js.svg?branch=master)](https://travis-ci.com/Submitty/pdf-annotate.js)
3+
[![Build Status](https://github.com/Submitty/pdf-annotate.js/workflows/Test/badge.svg?branch=gh_action&event=push)(https://github.com/Submitty/pdf-annotate.js/actions?query=workflow%3ATest+event%3Apush+branch%3Amaster)
44
[![codecov](https://codecov.io/gh/Submitty/pdf-annotate.js/branch/master/graph/badge.svg)](https://codecov.io/gh/Submitty/pdf-annotate.js)
55

66
Annotation layer for [PDF.js](https://github.com/mozilla/pdf.js).

0 commit comments

Comments
 (0)