From 8924dfa6fc3a585b6d6fdacf02ff54b544b3fab5 Mon Sep 17 00:00:00 2001 From: missinglink Date: Mon, 13 Sep 2021 18:05:02 +0200 Subject: [PATCH] chore(CI): add github actions workflow to replace travis/circle-ci --- .github/workflows/push.yml | 41 ++++++++++++++++++++++++++++++++++++++ .travis.yml | 19 ------------------ 2 files changed, 41 insertions(+), 19 deletions(-) create mode 100644 .github/workflows/push.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml new file mode 100644 index 0000000..32fb07e --- /dev/null +++ b/.github/workflows/push.yml @@ -0,0 +1,41 @@ +name: Continuous Integration +on: push +jobs: + unit-tests: + runs-on: '${{ matrix.os }}' + strategy: + matrix: + os: + - ubuntu-20.04 + node-version: + - 12.x + - 14.x + - 16.x + steps: + - uses: actions/checkout@v2 + - name: 'Install node.js ${{ matrix.node-version }}' + uses: actions/setup-node@v2-beta + with: + node-version: '${{ matrix.node-version }}' + - name: Run unit tests + run: | + npm install + npm run travis + npm-publish: + needs: unit-tests + if: github.ref == 'refs/heads/master' && github.event_name == 'push' + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + - name: Install node.js 12.x + uses: actions/setup-node@v2-beta + with: + node-version: 12.x + - name: Run semantic-release + env: + GH_TOKEN: ${{ secrets.GH_SEMANTIC_RELEASE_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + run: > + if [[ -n "$GH_TOKEN" && -n "$NPM_TOKEN" ]]; then + curl "https://raw.githubusercontent.com/pelias/ci-tools/master/semantic-release.sh" | bash - + fi diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 955e190..0000000 --- a/.travis.yml +++ /dev/null @@ -1,19 +0,0 @@ -sudo: false -language: node_js -notifications: - email: false -node_js: - - 10 - - 12 -script: npm run travis -before_install: - - npm i -g npm -branches: - except: - - /^v\d+\.\d+\.\d+$/ -jobs: - include: - - stage: release - node_js: 12 - script: curl "https://raw.githubusercontent.com/pelias/ci-tools/master/semantic-release.sh" | bash - - if: (branch = master) AND ( type = push )