build: output to both es module and commJS, PDFParser to be named export #5
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Node.js CI/CD | |
on: | |
pull_request: | |
branches: [ "*" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
outputs: | |
test-result: ${{ steps.test.outcome }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use Node.js 20.x # Updated for Node 20 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20.x | |
- name: Install dependencies | |
run: npm ci | |
- name: Run tests | |
id: test | |
run: npm test | |
check-tests: | |
needs: build # Depends on the 'build' job | |
runs-on: ubuntu-latest | |
if: ${{ always() }} | |
steps: | |
- uses: actions/github-script@v6 | |
with: | |
script: | | |
if (needs.build.outputs.test-result !== '0') { | |
core.setFailed('Tests failed - ' + needs.build.outputs.test-result + '. Please fix errors before merging.'); | |
} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |