Repository navigation
99 lines (78 loc) · 2.32 KB
/
Copy pathci.yml
File metadata and controls
99 lines (78 loc) · 2.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: AlgoRace CI
on:
push:
branches:
- master
- main
pull_request:
branches:
- master
- main
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
frontend-ci:
name: Frontend CI (Node ${{ matrix.node-version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: [20.x, 22.x]
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: frontend/package-lock.json
- name: Install Dependencies
run: npm --prefix frontend ci
- name: Run ESLint
run: npm --prefix frontend run lint
- name: Run Vitest Unit Tests
run: npm --prefix frontend test -- --run
- name: Run TypeScript Typecheck & Production Build
run: npm --prefix frontend run build
backend-ci:
name: Backend CI (Java 21 / Spring Boot 3.4)
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up JDK 21 (Eclipse Temurin)
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: 'maven'
- name: Check Code Formatting (Spotless)
run: mvn -f backend/pom.xml spotless:check
- name: Run JUnit 5 Test Suite
run: mvn -f backend/pom.xml test
- name: Package Production JAR
run: mvn -f backend/pom.xml package -DskipTests=false
docker-build:
name: Docker Build Verification
runs-on: ubuntu-latest
needs: [frontend-ci, backend-ci]
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build Backend Docker Image
uses: docker/build-push-action@v5
with:
context: ./backend
push: false
tags: algorace-backend:ci
- name: Build Frontend Docker Image
uses: docker/build-push-action@v5
with:
context: ./frontend
push: false
tags: algorace-frontend:ci