Full CI/CD Pipeline #1
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: Lint & Build | |
run-name: Full CI/CD Pipeline | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
branches: ["main"] | |
workflow_dispatch: | |
jobs: | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Node.js (Latest) | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "22.4.1" | |
- name: Install Dependencies | |
run: npm ci | |
- name: Run Linter | |
run: npm run lint | |
build: | |
needs: lint | |
name: Run Build Process | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [16.x, 17.x, 18.x, 19.x, 20.x, 21.x, 22.x] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Install Dependencies | |
run: npm ci | |
- name: Build Project | |
run: npm run build --if-present | |
- name: Verify SSR Compatibility (for Node.js 19+) | |
if: startsWith(matrix.node-version, '19') || startsWith(matrix.node-version, '20') || startsWith(matrix.node-version, '21') || startsWith(matrix.node-version, '22') | |
run: npm run validate:ssr | |
trigger-functional-tests: | |
needs: lint | |
name: "Run Tests" | |
uses: ./.github/workflows/test.yml | |
with: | |
node-version: "22.4.1" |