Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sma 20 add build and style checks to GitHub #17

Merged
merged 17 commits into from
Jan 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/build-gradle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle


name: Java CI with Gradle

on:
[push, pull_request]

permissions:
contents: read

jobs:
build:

runs-on: ubuntu-latest
defaults:
run:
working-directory: ./backend/sportsmatch

steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Execute Gradle build
run: ./gradlew build
28 changes: 28 additions & 0 deletions .github/workflows/build-react.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Build and Test React

on: [ push, pull_request ]

jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./frontend/sportsmatch-app

steps:
- name: Checkout code
uses: actions/checkout@v3

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

- name: Install dependencies
run: npm install

- name: Build frontend
run: npm run build

- name: Run test
run: npm test
25 changes: 25 additions & 0 deletions .github/workflows/checkstyle-react.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Check the React source code

on: [ push, pull_request ]

jobs:
test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./frontend/sportsmatch-app

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

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

- name: Install dependencies
run: npm install

- name: Lint
run: npm run lint
11 changes: 11 additions & 0 deletions backend/sportsmatch/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ plugins {
id 'java'
id 'org.springframework.boot' version '3.1.7'
id 'io.spring.dependency-management' version '1.1.4'
id 'checkstyle'
}

group = 'com'
Expand All @@ -10,6 +11,16 @@ version = '0.0.1-SNAPSHOT'
java {
sourceCompatibility = '17'
}
checkstyle {
configDirectory = file("$rootProject.projectDir/../../config/checkstyle")
toolVersion '10.12.7'
}
checkstyleMain {
source = 'src/main/java'
}
checkstyleTest {
source = 'src/test/java'
}

configurations {
compileOnly {
Expand Down
Loading