Merge pull request #17 from Abyss-fallers/snyk-upgrade-c933048f6ade0b… #26
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 Pipeline | |
on: | |
push: | |
branches: | |
- main | |
- dev | |
pull_request: | |
branches: | |
- main | |
- dev | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18' | |
- name: Cache node modules | |
uses: actions/cache@v3 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: Install dependencies | |
run: npm install | |
- name: Run Lint and Format | |
run: npm run lint && npm run lint:css && npm run format | |
- name: Run Tests | |
run: npm test | |
- name: Build Project | |
run: npm run build | |
clean_cache: | |
runs-on: ubuntu-latest | |
if: always() | |
steps: | |
- name: Clean npm cache | |
run: npm cache clean --force |