Skip to content

Commit 74388d2

Browse files
authored
Sma 20 add build and style checks to GitHub (#17)
1 parent fc267da commit 74388d2

37 files changed

+2778
-827
lines changed

.github/workflows/build-gradle.yml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
6+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle
7+
8+
9+
name: Java CI with Gradle
10+
11+
on:
12+
[push, pull_request]
13+
14+
permissions:
15+
contents: read
16+
17+
jobs:
18+
build:
19+
20+
runs-on: ubuntu-latest
21+
defaults:
22+
run:
23+
working-directory: ./backend/sportsmatch
24+
25+
steps:
26+
- uses: actions/checkout@v3
27+
- name: Set up JDK 17
28+
uses: actions/setup-java@v3
29+
with:
30+
java-version: '17'
31+
distribution: 'temurin'
32+
- name: Grant execute permission for gradlew
33+
run: chmod +x gradlew
34+
35+
- name: Execute Gradle build
36+
run: ./gradlew build

.github/workflows/build-react.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Build and Test React
2+
3+
on: [ push, pull_request ]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
defaults:
9+
run:
10+
working-directory: ./frontend/sportsmatch-app
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v3
15+
16+
- name: Setup Node.js
17+
uses: actions/setup-node@v4.0.1
18+
with:
19+
node-version: latest
20+
21+
- name: Install dependencies
22+
run: npm install
23+
24+
- name: Build frontend
25+
run: npm run build
26+
27+
- name: Run test
28+
run: npm test
+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Check the React source code
2+
3+
on: [ push, pull_request ]
4+
5+
jobs:
6+
test:
7+
runs-on: ubuntu-latest
8+
defaults:
9+
run:
10+
working-directory: ./frontend/sportsmatch-app
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: Setup Node.js
17+
uses: actions/setup-node@v4.0.1
18+
with:
19+
node-version: latest
20+
21+
- name: Install dependencies
22+
run: npm install
23+
24+
- name: Lint
25+
run: npm run lint

backend/sportsmatch/build.gradle

+11
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ plugins {
22
id 'java'
33
id 'org.springframework.boot' version '3.1.7'
44
id 'io.spring.dependency-management' version '1.1.4'
5+
id 'checkstyle'
56
}
67

78
group = 'com'
@@ -10,6 +11,16 @@ version = '0.0.1-SNAPSHOT'
1011
java {
1112
sourceCompatibility = '17'
1213
}
14+
checkstyle {
15+
configDirectory = file("$rootProject.projectDir/../../config/checkstyle")
16+
toolVersion '10.12.7'
17+
}
18+
checkstyleMain {
19+
source = 'src/main/java'
20+
}
21+
checkstyleTest {
22+
source = 'src/test/java'
23+
}
1324

1425
configurations {
1526
compileOnly {

0 commit comments

Comments
 (0)