Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI : Github action improvement #744

Merged
merged 4 commits into from
Nov 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 18 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,22 @@ jobs:
node-version: ${{ matrix.node-version }}
- name: Install
run: npm i
- name: Tests
run: npm run test
coverage:
name: coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Use Node.js 12
uses: actions/setup-node@v1
with:
node-version: 12
- name: Install
run: npm i
- name: run with coverage
if: (!startsWith(matrix.os, 'windows'))
run: npm run ci
# Windows just pass the test without checking the Coverage
# Due to skipped tests
- name: run without coverage
if: startsWith(matrix.os, 'windows')
run: npm run test
run: npm run cov-ci
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"browser-test": "airtap --local 8080 test/browser*test.js",
"test": "standard | snazzy && cross-env NODE_OPTIONS=\"--no-warnings -r qodaa\" tap --no-esm -j 4 --no-cov test/*test.js",
"ci": "standard | snazzy && cross-env TAP_TIMEOUT=480000 NODE_OPTIONS=\"--no-warnings -r qodaa\" tap --no-esm -j 4 --100 test/*test.js",
"cov-ci": "cross-env TAP_TIMEOUT=480000 NODE_OPTIONS=\"--no-warnings -r qodaa\" tap --no-esm -j 4 --100 --coverage-report=lcov test/*test.js",
"cov-ui": "cross-env NODE_OPTIONS=\"--no-warnings -r qodaa\" tap --no-esm -j 4 --coverage-report=html test/*test.js",
"bench": "node benchmarks/utils/runbench all",
"bench-basic": "node benchmarks/utils/runbench basic",
Expand Down
8 changes: 4 additions & 4 deletions test/basic.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ test('pino.destination', async ({ same }) => {
)
const instance = pino(pino.destination(tmp))
instance.info('hello')
await sleep(250)
await sleep(300)
const result = JSON.parse(readFileSync(tmp).toString())
delete result.time
same(result, {
Expand All @@ -498,7 +498,7 @@ test('auto pino.destination with a string', async ({ same }) => {
)
const instance = pino(tmp)
instance.info('hello')
await sleep(250)
await sleep(300)
const result = JSON.parse(readFileSync(tmp).toString())
delete result.time
same(result, {
Expand All @@ -517,7 +517,7 @@ test('auto pino.destination with a string as second argument', async ({ same })
)
const instance = pino(null, tmp)
instance.info('hello')
await sleep(250)
await sleep(300)
const result = JSON.parse(readFileSync(tmp).toString())
delete result.time
same(result, {
Expand All @@ -538,7 +538,7 @@ test('does not override opts with a string as second argument', async ({ same })
timestamp: () => ',"time":"none"'
}, tmp)
instance.info('hello')
await sleep(250)
await sleep(300)
const result = JSON.parse(readFileSync(tmp).toString())
same(result, {
pid: pid,
Expand Down