Skip to content
73 changes: 73 additions & 0 deletions .github/workflows/test_frontend.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Test Frontend

on:
push:
branches:
- main
paths:
- 'frontend/src/**'
- '.github/workflows/test_frontend.yaml'
pull_request:
branches:
- main
paths:
- 'frontend/src/**'
- '.github/workflows/test_frontend.yaml'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
frontend_tests:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./frontend

steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20.x

- name: Install dependencies
run: npm ci

# TODO: Disabled until `test:integration` is ran
# - name: Install playwright browsers
# run: npx playwright install --with-deps

# TODO: Disabled until type errors are fixed (ECharts, etc)
# - name: Run svelte-check
# run: npm run check

# TODO: Disabled until prettier format ran across project
# - name: Lint project (prettier format and eslint)
# run: npm run lint
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Enable linting step for code quality

The linting step is currently commented out. Linting is crucial for maintaining code quality and consistency. Consider enabling it to catch potential issues early.

Remove the comments to enable linting:

-      # - name: Lint project (prettier format and eslint)
-      #   run: npm run lint
+      - name: Lint project (prettier format and eslint)
+        run: npm run lint
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# - name: Lint project (prettier format and eslint)
# run: npm run lint
- name: Lint project (prettier format and eslint)
run: npm run lint


# TODO: Disabled until API is setup
# - name: Run unit tests (vitest)
# run: npm run test:unit
# env:
# CI: true

# TODO: Disabled until API is setup
# - name: Run integration tests (playwright)
# run: npm run test:integration
# env:
# CI: true

# TODO: Disabled until `test:integration` is ran
# - name: Upload playwright report
# uses: actions/upload-artifact@v4
# if: ${{ !cancelled() }}
# with:
# name: playwright-report
# path: playwright-report/
# retention-days: 30

- name: Build project
run: npm run build
Loading