From c561f89670fa6e7f98e69d8ad32c35541ddc7ab1 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Mon, 24 Feb 2020 01:12:01 +0100 Subject: [PATCH] switch test run to GitHub Actions --- .github/workflows/ci.yml | 48 ++++++++++++++++++++++++++++++++++++++++ .release-it.json | 2 +- .travis.yml | 17 -------------- README.md | 2 +- 4 files changed, 50 insertions(+), 19 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 0000000..a7f1a18 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,48 @@ +name: 'CI/CD Pipeline' + +on: [push] + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - uses: actions/setup-node@v1 + with: + node-version: '13.x' + - uses: actions/cache@v1 + with: + path: ~/.npm + key: ${{ runner.os }}-node + + - run: npm install + - name: Run tests & publish code coverage + uses: paambaati/codeclimate-action@v2.4.0 + with: + coverageCommand: npm test + env: + CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} + + publish: + needs: test + if: success() && startsWith(github.ref, 'refs/tags') + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: '13.x' + registry-url: 'https://registry.npmjs.org' + - run: npm install + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + - uses: actions/setup-node@v1 + with: + node-version: '13.x' + registry-url: 'https://npm.pkg.github.com' + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.release-it.json b/.release-it.json index 9d4a6da..cd7803b 100644 --- a/.release-it.json +++ b/.release-it.json @@ -10,6 +10,6 @@ "release": true }, "npm": { - "publish": true + "publish": false } } diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index b66c824..0000000 --- a/.travis.yml +++ /dev/null @@ -1,17 +0,0 @@ -language: node_js -node_js: node - -before_script: - - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter - - chmod +x ./cc-test-reporter - - ./cc-test-reporter before-build - -script: - - npm test - - npm run build - -after_script: - - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT - -notifications: - email: false diff --git a/README.md b/README.md index 0a6e65c..f824a28 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ # gatsby-plugin-matomo [![npm package](https://img.shields.io/npm/v/gatsby-plugin-matomo.svg)](https://www.npmjs.com/package/gatsby-plugin-matomo) -[![Build Status](https://travis-ci.com/kremalicious/gatsby-plugin-matomo.svg?branch=master)](https://travis-ci.com/kremalicious/gatsby-plugin-matomo) +[![Build Status](https://github.com/kremalicious/gatsby-plugin-matomo/workflows/CI%2FCD%20Pipeline/badge.svg)](https://github.com/kremalicious/gatsby-plugin-matomo/actions) [![Maintainability](https://api.codeclimate.com/v1/badges/067339a02f2058f5ba01/maintainability)](https://codeclimate.com/github/kremalicious/gatsby-plugin-matomo/maintainability) [![Test Coverage](https://api.codeclimate.com/v1/badges/067339a02f2058f5ba01/test_coverage)](https://codeclimate.com/github/kremalicious/gatsby-plugin-matomo/test_coverage) [![Greenkeeper badge](https://badges.greenkeeper.io/kremalicious/gatsby-plugin-matomo.svg)](https://greenkeeper.io/)