From 2173003be0b1baf1732d7723b7f3f8a799c54a4e Mon Sep 17 00:00:00 2001 From: Matthew Peveler Date: Fri, 31 Jul 2020 00:53:53 -0400 Subject: [PATCH 1/3] feat(test): move to using gh actions for testing Signed-off-by: Matthew Peveler --- .github/workflows/test.yml | 33 ++++++++++++++++++++++++++++++ .travis.yml | 42 -------------------------------------- 2 files changed, 33 insertions(+), 42 deletions(-) create mode 100644 .github/workflows/test.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..7dead2b7 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,33 @@ +name: Test + +on: + push: + branches: [ '*' ] + pull_request: + branches: [ '*' ] + +jobs: + test: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [10.x, 12.x, 14.x] + + steps: + - uses: actions/checkout@v2 + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + + - run: npm ci + + - run: npm run lint + - run: npm run build + + # todo: figure out why firefox is failing + - run: npm test -- --browsers ChromeHeadless + + - uses: codecov/codecov-action@v1 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index e73ad9e5..00000000 --- a/.travis.yml +++ /dev/null @@ -1,42 +0,0 @@ -language: node_js -dist: trusty -sudo: true -node_js: - - '8' - - '10' - - '12' - -addons: - chrome: stable - firefox: latest - -install: - - npm ci - -script: - - npm run lint - - npm test -- --browsers ChromeHeadless - - npm run build - -after_script: - - npm run codecov - -notifications: - email: - on_failure: change - on_success: never - -deploy: - provider: releases - api_key: - secure: nRrDJmE06RQj+C8Zalhs4d2/OQ3ERvLXGQNZa7NUxg25TFz9U+8CAMc1Z79bNSNy2OW7LiUoyL31P+EmRFGScsrh6/k7DGR+it2PqI+dw2sxA0W6KmKI5sJpK4WRfYFlAku4rTaejfMtEwdq39pK87MYESRqXy5YvJAdS8mi/htV1+nbyqclXv/uf4ti9CfZsbYUQBv+wteQwWcgb6WywnoXTrTEp/PBiOddpicYbyhgwQcLBWvUNyFy3Qf6GX45qMzOo0IQUdqsf+nD5kPYWGDJHJJjJ/CafWD7vUxcxpcnVMmx3jUAv+Zx8QulpuZSzTalJxnlJ0BQHcsdnlx4Pjx6OMIU36Wotgbp1QYnt0FuJtOZ1+wl+MUh2Lm3ZEFjLy3ijCD5lSPfN03a/rzRDjei3EcWP8bCimM/xqxoSkJNZjHVtu8lv3MDSeOl3gkKCZIPQrrZG/EPxwZXtw49FiD1m9hpxL+l5VQWiFNG4RbiFhEza7Lx7JJR9eWE832PBIViRF9w3ZgqXczUUT2+NHDckW0WUTbddYE1Rajn5YNriW3tylg6N0+pjydxPugK++O6Z28Hd+Do+kFFPreEf+JZAg6Mnv6L7YJ0b+NpC1XMRQvPckyFiiCR0I46/Qm+1IUKJmVvf/dYApRuUJ+E81GNFzIn+YYmYzmUlfeh120= - file: - - dist/pdf-annotate.js - - dist/pdf-annotate.js.map - - dist/pdf-annotate.min.js - - dist/pdf-annotate.min.js.map - skip_cleanup: true - on: - tags: true - node: '8' - repo: Submitty/pdf-annotate.js From a4ceeff2a566b926c2895bcca76ba46c711fb023 Mon Sep 17 00:00:00 2001 From: Matthew Peveler Date: Fri, 31 Jul 2020 01:06:27 -0400 Subject: [PATCH 2/3] add publish workflow Signed-off-by: Matthew Peveler --- .github/workflows/publish.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 00000000..ef2f7f53 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,31 @@ +name: Publish + +on: + release: + types: [published] + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - uses: actions/setup-node@v1 + with: + node-version: 12 + registry-url: https://registry.npmjs.org/ + + - run: npm ci + - run: npm run build + + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} + + - name: Upload binaries to release + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: dist/pdf-annotate*.js* + tag: ${{ github.ref }} + overwrite: true + file_glob: true From c81bfd69c7431356131ce702d9cf7db47b53f226 Mon Sep 17 00:00:00 2001 From: Matthew Peveler Date: Fri, 31 Jul 2020 01:10:40 -0400 Subject: [PATCH 3/3] update test badge in README Signed-off-by: Matthew Peveler --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1c858265..218a1b7d 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # pdf-annotate.js -[![Build Status](https://travis-ci.com/Submitty/pdf-annotate.js.svg?branch=master)](https://travis-ci.com/Submitty/pdf-annotate.js) +[![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) [![codecov](https://codecov.io/gh/Submitty/pdf-annotate.js/branch/master/graph/badge.svg)](https://codecov.io/gh/Submitty/pdf-annotate.js) Annotation layer for [PDF.js](https://github.com/mozilla/pdf.js).