Skip to content

Commit

Permalink
add frontend ci
Browse files Browse the repository at this point in the history
  • Loading branch information
lwaekfjlk committed Aug 1, 2024
1 parent 4c45c4c commit f50b9f0
Showing 1 changed file with 67 additions and 0 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/frontend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Lint and Test

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

on:
push:
branches:
- main
pull_request:

jobs:
lint-and-test:
name: Lint and Test Frontend
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [14, 16, 18, 20]

steps:
- uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Cache Node.js modules
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-${{ matrix.node-version }}-
- name: Install dependencies
run: npm install --frozen-lockfile

- name: Lint code
run: npm run lint

- name: Run unit tests
run: npm test

- name: Run integration tests
run: npm run test:integration

- name: Run E2E tests
run: npm run test:e2e

- name: Build project
run: npm run build

notify:
name: Notify on Failure
runs-on: ubuntu-latest
if: failure()
steps:
- name: Send Slack notification
uses: 8398a7/action-slack@v3
with:
status: ${{ job.status }}
fields: repo,message,commit,author,action,eventName,ref,workflow,job,took
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

0 comments on commit f50b9f0

Please sign in to comment.