Skip to content

Commit

Permalink
build(frontend): test the frontend build in ci (#580)
Browse files Browse the repository at this point in the history
Run a type check, install, and build for the frontend in the CI pipeline.
  • Loading branch information
eatyourgreens authored Nov 22, 2024
1 parent 176429c commit 6ec1a2c
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 2 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/frontend-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Frontend build

on:
pull_request:
push:
branches:
- master
- ui-enhancements
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./frontend-v2
steps:
- uses: actions/checkout@v4
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: "lts/iron"
cache: "yarn"
cache-dependency-path: ./frontend-v2/yarn.lock
- name: Install dependencies
run: yarn install --immutable
- name: Build
run: npm run build
4 changes: 2 additions & 2 deletions frontend-v2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
"react-toastify": "^9.1.3"
},
"scripts": {
"start": "vite",
"build": "vite build",
"start": "npx tsc && vite",
"build": "npx tsc && vite build",
"serve": "vite preview",
"lint": "eslint src",
"format": "prettier --write ./src",
Expand Down
1 change: 1 addition & 0 deletions frontend-v2/src/App.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ test("renders learn react link", () => {
</Provider>,
);

// @ts-expect-error toBeInTheDocument doesn't exist in recent versions of Jest.
expect(getByText(/learn/i)).toBeInTheDocument();
});
1 change: 1 addition & 0 deletions frontend-v2/src/features/model/resetToSpeciesDefaults.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-expect-error MutationTrigger isn't exported from Redux any more.
import { MutationTrigger } from "@reduxjs/toolkit/dist/query/react/buildHooks";
import {
CombinedModelRead,
Expand Down

0 comments on commit 6ec1a2c

Please sign in to comment.