test error solved 2 #33
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
# .github/workflows/ci.yml | |
name: CI for Express TypeScript App | |
# Trigger this workflow on every push or pull request to the main branch | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
build: | |
# Define the environment to run this job on | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: ['18.x', '20.x'] | |
# Steps for the job | |
steps: | |
# Step 1: Checkout the code | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
# Step 2: Set up Node.js | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Cache npm dependencies | |
uses: actions/cache@v3 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-npm- | |
# Step 3: Install dependencies | |
- name: Install dependencies | |
run: npm install | |
# Step 4: Build the TypeScript code | |
- name: Build project | |
run: npm run build | |
# Step 5: Run tests (we haven't added any tests yet, so this will skip) | |
- name: Run tests | |
run: npm test |