chore(deps-dev): bump eslint from 9.15.0 to 9.16.0 #60
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: PR Checks | |
on: | |
pull_request: | |
branches: | |
- main # Run checks on PRs to the main branch | |
permissions: | |
contents: write | |
jobs: | |
pr-checks: | |
name: Run PR Checks | |
runs-on: ubuntu-latest # Ubuntu environment | |
steps: | |
# Step 1: Checkout the repository | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Fetch all history for accurate builds | |
# Step 2: Set up Node.js (use version 20) | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "20" | |
cache: "npm" # Cache node_modules to improve speed | |
# Step 3: Install dependencies using npm ci | |
- name: Install dependencies | |
run: npm ci | |
# Step 4: Run TypeScript Type-Checking | |
- name: Run TypeScript Type-Checking | |
run: npx tsc --noEmit | |
continue-on-error: false # Fail the PR if type-checking fails | |
# Step 5: Build the project | |
- name: Build the project | |
run: npm run build | |
# Step 6: Run linting | |
- name: Run Linting | |
run: npm run lint | |
# Step 7: Run Unit Tests with Coverage | |
- name: Run Tests with Coverage | |
run: npm run test | |
env: | |
CI: true # Ensure tests run in CI mode | |
# Step 8: Enforce Code Coverage Threshold | |
- name: Check Code Coverage Threshold | |
run: | | |
npm run test -- --coverage --coverageThreshold='{ | |
"global": { | |
"statements": 100, | |
"lines": 100, | |
"branches": 50, | |
"functions": 50 | |
} | |
}' | |
continue-on-error: false # Fail if coverage doesn't meet the threshold |