Adding examples #12
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: CI - Node.js | |
on: | |
push: | |
branches: | |
- main | |
- release/* | |
pull_request: | |
branches: | |
- '**' | |
jobs: | |
build-and-test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [16.x, 18.x, 20.x] | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
- name: Set Up Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: 'npm' | |
- name: Install Dependencies (With Legacy Peer Deps) | |
run: npm install --legacy-peer-deps | |
- name: Debug Environment | |
run: | | |
node -v | |
npm -v | |
echo "Installed packages:" | |
npm list | |
- name: Run Build (If Applicable) | |
run: npm run build --if-present | |
- name: Run Tests | |
run: npm test | |
- name: Upload Coverage (Optional) | |
if: success() | |
run: npm run coverage --if-present |