Skip to content

Merge pull request #5 from marcomontalbano/major-update #2

Merge pull request #5 from marcomontalbano/major-update

Merge pull request #5 from marcomontalbano/major-update #2

Workflow file for this run

name: Node CI
on: [push]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node: [18.x, 20.x, 22.x]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- name: Project setup `npm ci`
run: npm ci
- name: Run `test`
run: npm test
coverage:
needs: [test]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20.x
- name: Project setup `npm ci`
run: npm ci
- name: Run `coverage`
run: npm run coverage
- name: Export `coverage`
env:
NODE_COVERALLS_DEBUG: 0
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
COVERALLS_GIT_COMMIT: ${{ github.sha }}
COVERALLS_GIT_BRANCH: ${{ github.ref }}
run: |
npm install coveralls
cat coverage/lcov.info | ./node_modules/.bin/coveralls
- name: Upload `coverage` artifact
uses: actions/upload-artifact@v4
with:
name: coverage
path: coverage/lcov-report
stryker:
needs: [test]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20.x
- name: Project setup `npm ci`
run: npm ci
- name: Run `stryker`
run: npm run stryker
- name: Upload `stryker` artifact
uses: actions/upload-artifact@v4
with:
name: stryker
path: reports/mutation/html
publish:
needs: [test, coverage]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
if: github.ref == 'refs/heads/master'
- uses: actions/setup-node@v4
if: github.ref == 'refs/heads/master'
with:
node-version: 20.x
- name: Project setup `npm ci && npm run build`
if: github.ref == 'refs/heads/master'
run: |
npm ci
npm run build --if-present
env:
CI: true
- name: Run `publish`
if: github.ref == 'refs/heads/master'
run: npm run publish --if-present