Fix path in GitHub Actions workflow for sample analysis script #3
This file contains hidden or 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: CI/CD Pipeline | |
on: | |
push: | |
branches: [main, master] | |
pull_request: | |
branches: [main, master] | |
workflow_dispatch: | |
jobs: | |
build-and-test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [16.x, 18.x] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: "npm" | |
- name: Install dependencies | |
run: npm ci | |
- name: Run tests | |
run: npm test | |
- name: Run test with coverage | |
run: npm run test:coverage | |
- name: Build project | |
run: npm run build | |
- name: Run sample analysis | |
run: node dist/package-dependencies.js sample-dependencies.jsonl -o sample-analysis.md | |
if: success() | |
- name: Upload test coverage | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage-report | |
path: coverage/ | |
if: success() | |
- name: Upload sample analysis | |
uses: actions/upload-artifact@v4 | |
with: | |
name: sample-analysis | |
path: sample-analysis.md | |
if: success() |