From 04ee6310fb0ce0c9d2c925ca4e3391839699381a Mon Sep 17 00:00:00 2001 From: Ben McCann <322311+benmccann@users.noreply.github.com> Date: Fri, 20 Nov 2020 11:58:55 -0800 Subject: [PATCH 1/3] Migrate to Github Actions --- .github/workflows/ci.yml | 33 +++++++++++++++++++++++++++ .travis.yml | 48 ---------------------------------------- 2 files changed, 33 insertions(+), 48 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..f46cd5e3c --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,33 @@ +name: CI + +on: + push: + branches: + - master + pull_request: + +jobs: + build: + runs-on: ${{ matrix.os }} + + strategy: + matrix: + os: [ubuntu-latest, windows-latest] + fail-fast: false + + steps: + - uses: actions/checkout@v2 + - name: Use Node.js + uses: actions/setup-node@v1 + - name: Build and Test + run: | + npm ci + npm run build + if [ "${{ runner.os }}" == "Windows" ]; then + npm test + elif [ "${{ runner.os }}" == "macOS" ]; then + npm test --browsers chrome,safari + else + xvfb-run --auto-servernum npm test + fi + shell: bash diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index ef88f401c..000000000 --- a/.travis.yml +++ /dev/null @@ -1,48 +0,0 @@ -language: node_js -node_js: - - "lts/*" - -before_install: - - "export CHROME_BIN=/usr/bin/google-chrome" - - "export DISPLAY=:99.0" - - "sh -e /etc/init.d/xvfb start" - -script: - - gulp test --coverage - - gulp build - - gulp package - - gulp bower - - cat ./coverage/lcov.info | ./node_modules/.bin/coveralls || true - -sudo: required -dist: trusty - -addons: - chrome: stable - firefox: latest - -# IMPORTANT: scripts require GITHUB_AUTH_TOKEN and GITHUB_AUTH_EMAIL environment variables -# IMPORTANT: scripts has to be set executables in the Git repository (error 127) -# https://github.com/travis-ci/travis-ci/issues/5538#issuecomment-225025939 - -deploy: - - provider: script - script: ./scripts/release.sh - skip_cleanup: true - on: - branch: release - - provider: releases - api_key: $GITHUB_AUTH_TOKEN - file: - - "./dist/chartjs-plugin-zoom.js" - - "./dist/chartjs-plugin-zoom.min.js" - - "./dist/chartjs-plugin-zoom.zip" - skip_cleanup: true - on: - tags: true - - provider: npm - email: $NPM_AUTH_EMAIL - api_key: $NPM_AUTH_TOKEN - skip_cleanup: true - on: - tags: true From 6981e3c9db8321508a6e73c9cfa86a2deacaf47d Mon Sep 17 00:00:00 2001 From: Ben McCann <322311+benmccann@users.noreply.github.com> Date: Fri, 20 Nov 2020 12:55:46 -0800 Subject: [PATCH 2/3] reorder statements --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f46cd5e3c..4062578f1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,10 +1,10 @@ name: CI on: + pull_request: push: branches: - master - pull_request: jobs: build: From a81393e0f20b0d4ab158c209cbde6b60cdc6c5b0 Mon Sep 17 00:00:00 2001 From: Ben McCann <322311+benmccann@users.noreply.github.com> Date: Fri, 20 Nov 2020 12:59:05 -0800 Subject: [PATCH 3/3] simplify --- .github/workflows/ci.yml | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4062578f1..82291f478 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,27 +7,16 @@ on: - master jobs: - build: + Tests: runs-on: ${{ matrix.os }} - + timeout-minutes: 6 strategy: matrix: os: [ubuntu-latest, windows-latest] fail-fast: false - steps: - uses: actions/checkout@v2 - - name: Use Node.js - uses: actions/setup-node@v1 - - name: Build and Test - run: | - npm ci - npm run build - if [ "${{ runner.os }}" == "Windows" ]; then - npm test - elif [ "${{ runner.os }}" == "macOS" ]; then - npm test --browsers chrome,safari - else - xvfb-run --auto-servernum npm test - fi - shell: bash + - uses: actions/setup-node@v1 + - run: npm ci + - run: npm run build + - run: npm test