Skip to content

Commit

Permalink
ci: add build workflow for client (#107)
Browse files Browse the repository at this point in the history
* ci: add build workflow for client

- Implemented a GitHub Actions workflow for building the client application.
- Ensures that changes to the client are validated through automated builds.

* fix: cd to client directory

* fix: remove updated at UserDTO property

* fix: resolve config plugin overload
  • Loading branch information
Fingertips18 authored Jan 18, 2025
1 parent c7133ce commit bcc719c
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 8 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/client-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Client - Build

on:
pull_request:
branches:
- develop
workflow_dispatch:

jobs:
build:
name: Build Application
runs-on: ubuntu-latest

steps:
- name: Checkout Code
uses: actions/checkout@v4

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

- name: Install Dependencies
run: |
cd client
npm ci --cache .npm --prefer-offline
- name: Run Build
run: |
cd client
npm run build
- name: Upload Build Artifact
uses: actions/upload-artifact@v4
with:
name: client-app
path: app
2 changes: 1 addition & 1 deletion .github/workflows/client-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Install dependencies
run: |
cd client
npm install
npm ci --cache .npm --prefer-offline
- name: Run vitest
run: |
Expand Down
6 changes: 3 additions & 3 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion client/src/lib/services/sign-in.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ const user: UserDTO = {
last_signed_in: new Date(),
is_verified: false,
created_at: new Date(),
updated_at: new Date(),
};

describe("signIn", () => {
Expand Down
14 changes: 11 additions & 3 deletions client/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,25 @@
import { defineConfig as testConfig } from "vitest/config";
import { defineConfig as viteConfig } from "vite";
import react from "@vitejs/plugin-react-swc";
import { defineConfig } from "vitest/config";
import path from "path";

// https://vitejs.dev/config/
export default defineConfig({
const defineViteConfig = viteConfig({
plugins: [react()],
resolve: {
alias: {
"@": path.resolve(__dirname, "src"),
},
},
});

const defineTestConfig = testConfig({
test: {
globals: true,
environment: "jsdom",
},
});

export default {
...defineViteConfig,
...defineTestConfig,
};

0 comments on commit bcc719c

Please sign in to comment.