Skip to content

Fix some stuffs

Fix some stuffs #67

Workflow file for this run

name: CI/CD Pipeline
on:
push:
branches:
- main
- staging
pull_request:
branches:
- main
- staging
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./src
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: "20"
cache: "npm"
cache-dependency-path: src/package-lock.json
- name: Install dependencies
run: npm ci
- name: Check formatting
id: format
run: npx prettier . --check
continue-on-error: true
- name: Run linter
id: lint
run: npm run lint
continue-on-error: true
- name: Run tests
id: test
run: npm test
continue-on-error: true
- name: Annotate formatting errors
if: steps.format.outcome != 'success'
run: echo "Formatting errors found"
- name: Annotate linter errors
if: steps.lint.outcome != 'success'
run: echo "Linter errors found"
- name: Annotate test errors
if: steps.test.outcome != 'success'
run: echo ":Test errors found"
- name: Fail the job if any checks failed
if: steps.format.outcome != 'success' || steps.lint.outcome != 'success' || steps.test.outcome != 'success'
run: exit 1