From 71280e6e5f4190528216ba82276efdc1aab62927 Mon Sep 17 00:00:00 2001 From: Laura Seidler Date: Wed, 29 Sep 2021 14:55:07 +0200 Subject: [PATCH 1/3] Replace Travis workflow with GitHub action This keeps the existing matrix intact, but also adds node 14 as the current LTS. --- .github/workflows/test.yml | 34 ++++++++++++++++++++++++++++++++++ .travis.yml | 19 ------------------- 2 files changed, 34 insertions(+), 19 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 0000000..6c88788 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,34 @@ +# This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions + +name: Test with coverage + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + test: + runs-on: ubuntu-latest + + strategy: + matrix: + node: [10, 12, 14] + hapi: ["@hapi/hapi@18", "@hapi/hapi@19", "@hapi/hapi@20"] + exclude: + - node: 10 + hapi: "@hapi/hapi@19" + - node: 10 + hapi: "@hapi/hapi@20" + + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node }} + uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node }} + - run: npm install + - run: npm install ${{ matrix.hapi }} + - run: npm run coveralls diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index e6edb99..0000000 --- a/.travis.yml +++ /dev/null @@ -1,19 +0,0 @@ -language: node_js -sudo: false -node_js: - - "10" - - "12" -env: - - HAPI=@hapi/hapi@18 - - HAPI=@hapi/hapi@19 - - HAPI=@hapi/hapi@20 -matrix: - exclude: - - node_js: 10 - env: HAPI=@hapi/hapi@19 - - node_js: 10 - env: HAPI=@hapi/hapi@20 -before_script: - - npm install --save-dev $HAPI -after_script: - - npm run coveralls From 892a2620bf56167e5290c073c61fe2e974eeb40f Mon Sep 17 00:00:00 2001 From: Laura Seidler Date: Wed, 29 Sep 2021 15:12:53 +0200 Subject: [PATCH 2/3] Use coveralls GitHub action --- .github/workflows/test.yml | 18 +++++++++++++++++- package.json | 1 + 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6c88788..47fe4e9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -31,4 +31,20 @@ jobs: node-version: ${{ matrix.node }} - run: npm install - run: npm install ${{ matrix.hapi }} - - run: npm run coveralls + - run: npm run coverage:lcov + - name: Coveralls Parallel + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + flag-name: run-${{ matrix.node }}-${{ matrix.hapi }} + parallel: true + + finish: + needs: test + runs-on: ubuntu-latest + steps: + - name: Coveralls Finished + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + parallel-finished: true diff --git a/package.json b/package.json index 658dc49..14eed83 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "main": "index.js", "scripts": { "coverage": "lab test.js -c", + "coverage:lcov": "lab test.js -r lcov -o coverage/lcov.info", "coveralls": "lab test.js -r lcov | coveralls", "test": "standard && lab --timeout 100000 test.js" }, From 2e549fc84256b19ca478c3dac342ebbc77a0a0a2 Mon Sep 17 00:00:00 2001 From: Laura Seidler Date: Wed, 29 Sep 2021 15:27:42 +0200 Subject: [PATCH 3/3] Update README badge --- .github/workflows/test.yml | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 47fe4e9..0fab713 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,7 +1,7 @@ # This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions -name: Test with coverage +name: tests on: push: diff --git a/README.md b/README.md index 3f13f16..c476198 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# hapi-pino  [![Build Status](https://travis-ci.org/pinojs/hapi-pino.svg)](https://travis-ci.org/pinojs/hapi-pino) [![Coverage Status](https://coveralls.io/repos/github/pinojs/hapi-pino/badge.svg?branch=master)](https://coveralls.io/github/pinojs/hapi-pino?branch=master) +# hapi-pino  ![Tests Status](https://github.com/pinojs/hapi-pino/actions/workflows/test.yml/badge.svg) [![Coverage Status](https://coveralls.io/repos/github/pinojs/hapi-pino/badge.svg?branch=master)](https://coveralls.io/github/pinojs/hapi-pino?branch=master) [Hapi](http://hapijs.com) plugin for the [Pino](https://github.com/pinojs/pino) logger. It logs in JSON for easy