Skip to content

Commit

Permalink
feat: add workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
eggachecat committed Jan 21, 2024
1 parent efb6a16 commit add9258
Showing 1 changed file with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/on-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Tests
on: [push, pull_request]
env:
CI: true

jobs:
test:
name: Node ${{ matrix.node }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
node: [ 14, 16, 18, 19]
os: [ubuntu-latest]

steps:
- name: Clone repository
uses: actions/checkout@v3

- name: Set Node.js version
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}

- name: Install npm dependencies
run: npm install # switch to `npm ci` when Node.js 6 support is dropped

- name: Run lint
run: npm run lint

- name: Run tests
run: npm run test

- name: test token
run: echo "${{ secrets.COVERALLS_REPO_TOKEN }}"

- name: Coveralls
run: cat ./coverage/lcov.info | node ./bin/coveralls.js
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
COVERALLS_SERVICE_NAME: CI-pipeline
COVERALLS_SERVICE_JOB_ID: ${{github.run_id}}
COVERALLS_SERVICE_JOB_NUMBER: ${{github.run_number}}
COVERALLS_FLAG_NAME: ${{matrix.os}}-node-${{ matrix.node }}
COVERALLS_PARALLEL: true
NODE_COVERALLS_DEBUG: 1

finish:
needs: test
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v2

- name: Coveralls Finished
run: |
curl -kv -d 'payload[build_num]=${{github.run_id}}&payload[status]=done' https://coveralls.io/webhook?repo_token=${COVERALLS_REPO_TOKEN}
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}

0 comments on commit add9258

Please sign in to comment.