From 601854fbf8ce0cf76603c6d8097563afa16a235a Mon Sep 17 00:00:00 2001 From: Keith Cirkel Date: Fri, 25 Oct 2019 14:25:38 +0100 Subject: [PATCH] Build: Use GitHub Actions for CI/CD (#255) * build: Use GitHub Actions for CI/CD * build: add github token to publish step Co-Authored-By: Austin Cawley-Edwards * build: drop travis --- .github/workflows/ci.yml | 46 ++++++++++++++++++++++++++++++++++++++++ .travis.yml | 43 ------------------------------------- 2 files changed, 46 insertions(+), 43 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..1e865dc --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,46 @@ +name: Chai HTTP + +on: + pull_request: + branches: + - master + push: + branches: + - master + +jobs: + build: + name: Test on node ${{ matrix.node_version }} + runs-on: ubuntu-latest + strategy: + matrix: + node_version: + - 8 # to be removed 2020-01 + - 10 # to be removed 2021-01 + - x.x.x # safety net; don't remove + steps: + - uses: actions/checkout@v1 + - uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node_version }} + - run: npm i -g npm@6 && npm ci + - run: npm test + - uses: coverallsapp/github-action@v1.0.1 + with: + github-token: ${{ secrets.github_token }} + + + publish-npm: + needs: build + 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 run release + if: github.event == 'push' + env: + NPM_TOKEN: ${{secrets.NPM_TOKEN}} + GITHUB_TOKEN: ${{secrets.github_token}} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 01db124..0000000 --- a/.travis.yml +++ /dev/null @@ -1,43 +0,0 @@ -language: node_js -node_js: - - 4 # to be removed 2018-04-01 - - 6 # to be removed 2019-04-01 - - 7 # to be removed 2017-06-30 - - 8 # to be removed 2020-01 - - 10 # to be removed 2021-01 - - lts/* # safety net; don't remove - - node # safety net; don't remove - -stages: - - test - - release - -jobs: - include: - - stage: test - script: - - npm test - after_success: - - npm run coverage - - stage: release - node_js: 10 - script: skip - env: - # NPM - - secure: fM77hue6ws/ikKaCzUsy6o3urxBHH0YjNSP3Dzc1Qm6oBthe8AYMifV7O93JI3T9ne4jDJvXcCCxgCOBr7gYr7U2/W+X144MphuBbqlTRxusKKBYCtK0QatjM9Px07f1lWLhgcEbwAayr9l9JSSJk4y5T7zk0Ij02gHapB0PPv8= - # GitHub - - secure: brL77ysx1Z30fGqeTLtdhVYCdMXFi6kbQYpQB2w9CtJJeI9zKZDagYKSjHpY1kzgUN0BoXG/Kyr1EgXsE2nBHjWYPKsxcbNP8gEAl8I6J7LBNVrxYkJNzQ46jYIjtjAWwodbQGAz0LrH5b8sw8IwE8vcxZ4thfZupA50LC8VdWA= - deploy: - provider: script - skip_cleanup: true - script: - - npm run release - 'on': - repo: chaijs/chai-http - branches: - only: - - master -env: - global: - # Coveralls - - secure: DGaDDxh76Gv+qmu4SLuQDxmmZMpMiiVdIvveT1d3ly93zrqT7Pb9ur7P8Yz77AxU9UrMHEJ3Be05Uqe8xtTJCIora9io/tX4QLRtIXtRIOA3dYaYNBgXztQT7yzCi6E/L/DZa1+dNaGDpoUnLG0S3vpwhi3YjlWJDhLOfB3Txx0=