Skip to content

Commit

Permalink
✅ Test in multiple version of node in CI
Browse files Browse the repository at this point in the history
This also clarify node support policy of Wretch in readme
  • Loading branch information
Holi0317 committed Jul 4, 2022
1 parent 1ff926c commit 00d80a6
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 11 deletions.
14 changes: 3 additions & 11 deletions .github/workflows/ci.yml → .github/workflows/browser.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI
name: Browser test

on:
pull_request:
Expand All @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/setup-node@v3
with:
cache: 'npm'
- name: BrowserStack Env Setup
Expand All @@ -28,22 +28,14 @@ jobs:
local-testing: start
local-identifier: random
- name: Install dependencies
run: npm i
run: npm ci
- name: Build
run: npm run build
- name: Unit tests
run: npm run test
- name: Browser tests
run: npm run test-browsers
- name: 'BrowserStackLocal Stop' # Terminating the BrowserStackLocal tunnel connection
uses: browserstack/github-actions/setup-local@master
if: ${{ always() }}
with:
local-testing: stop
- name: Coveralls
if: ${{ success() }}
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: "./coverage/lcov.info"

48 changes: 48 additions & 0 deletions .github/workflows/node.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Node.JS test

on:
pull_request:
branches:
- "**"
push:
branches:
- master
workflow_dispatch:

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
# Remember to update README.md and package.json when updating the version matrix
version: [14, 16, 18]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.version }}
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Unit tests
run: npm run test
- name: Coveralls
if: ${{ success() }}
uses: coverallsapp/github-action@master
with:
parallel: true
flag-name: node-${{ matrix.version }}
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: "./coverage/lcov.info"

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

0 comments on commit 00d80a6

Please sign in to comment.