Skip to content

Commit 12efe8d

Browse files
authored
Add CI test actions (#1)
1 parent 7fb1469 commit 12efe8d

File tree

5 files changed

+81
-7
lines changed

5 files changed

+81
-7
lines changed

.github/workflows/ci.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: CI - Test and Validate
2+
3+
on:
4+
push:
5+
branches: [ master, main, dev, develop ]
6+
pull_request:
7+
branches: [ master, main ]
8+
9+
jobs:
10+
validate-frontend:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: Setup Node.js
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: '22'
20+
cache: 'yarn'
21+
cache-dependency-path: frontend/yarn.lock
22+
23+
- name: Install frontend dependencies
24+
working-directory: ./frontend
25+
run: yarn install --frozen-lockfile
26+
27+
- name: Lint frontend code
28+
working-directory: ./frontend
29+
run: yarn lint
30+
31+
- name: Type check frontend
32+
working-directory: ./frontend
33+
run: yarn type-check
34+
35+
- name: Build frontend
36+
working-directory: ./frontend
37+
run: yarn build
38+
39+
- name: Test frontend Docker build
40+
run: |
41+
docker build -t fcc-physics-events-frontend:test ./frontend/
42+
echo "Frontend Docker build successful"
43+
44+
validate-backend:
45+
runs-on: ubuntu-latest
46+
steps:
47+
- name: Checkout code
48+
uses: actions/checkout@v4
49+
50+
- name: Set up Python
51+
uses: actions/setup-python@v5
52+
with:
53+
python-version: '3.12'
54+
55+
- name: Install uv
56+
uses: astral-sh/setup-uv@v4
57+
with:
58+
version: "0.7.14"
59+
60+
- name: Install backend dev dependencies
61+
working-directory: ./backend
62+
run: |
63+
uv sync --frozen --no-install-project --only-dev
64+
65+
- name: Lint backend code
66+
working-directory: ./backend
67+
run: |
68+
uv run ruff check .
69+
70+
- name: Type check backend
71+
working-directory: ./backend
72+
run: |
73+
uv run mypy app
74+
75+
- name: Test backend Docker build
76+
run: |
77+
docker build -t fcc-physics-events-backend:test ./backend/
78+
echo "Backend Docker build successful"

backend/app/storage/database_modules/data_import_module.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -521,9 +521,6 @@ async def _create_main_entity(
521521

522522
valid_columns = await get_valid_table_columns(conn, main_table)
523523

524-
# Get the configured entity name field from config
525-
entity_name_field = "name"
526-
527524
# Exclude system columns that shouldn't be set directly
528525
system_columns = {
529526
"name",

backend/app/storage/json_data_model.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,8 @@ def get_all_metadata(self) -> dict[str, Any]:
211211
metadata: dict[str, Any] = {}
212212

213213
# Add core fields that have values (excluding navigation fields)
214-
if self.title is not None:
215-
metadata["title"] = self.title
214+
if self.name is not None:
215+
metadata["name"] = self.name
216216
if self.description is not None:
217217
metadata["description"] = self.description
218218
if self.comment is not None:

frontend/components/AdminModal.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@
146146
accept=".json"
147147
class="hidden"
148148
@change="handleFileSelection"
149-
/>
149+
>
150150

151151
<!-- Force Override Checkbox -->
152152
<div class="flex items-center gap-2 p-3 bg-amber-50 border border-amber-200 rounded-lg">

frontend/composables/auth/useAuth.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ interface AuthState {
2222
*/
2323
export function useAuth() {
2424
const { initiateLogin, logoutUser, getSessionStatus, manualRefreshToken } = useApiClient();
25-
const config = useRuntimeConfig();
2625

2726
// Use global state to ensure consistency across components
2827
const authState = useState<AuthState>(

0 commit comments

Comments
 (0)