diff --git a/.github/workflows/test_frontend.yaml b/.github/workflows/test_frontend.yaml new file mode 100644 index 0000000000..d29d727d1c --- /dev/null +++ b/.github/workflows/test_frontend.yaml @@ -0,0 +1,71 @@ +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 + + - name: Run svelte-check (svelte errors, type errors) + run: npm run check + + - 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 \ No newline at end of file diff --git a/frontend/.prettierignore b/frontend/.prettierignore index ab78a95ddd..2027007ea3 100644 --- a/frontend/.prettierignore +++ b/frontend/.prettierignore @@ -2,3 +2,13 @@ package-lock.json pnpm-lock.yaml yarn.lock + +# SvelteKit build +.svelte-kit +build + +# Playwright test results +test-results + +# Thift types +src/lib/types/codegen \ No newline at end of file