Skip to content
Open
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
42 changes: 42 additions & 0 deletions .github/workflows/CI_backend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# worflow for building the back end

name: "Java backend CI" # the name of the job when ran

# events that will trigger this workflow to run
on:
push:
branches: [ "main", "develop"]
paths: # only trigger if changes in this paths
- 'backend/**'
pull_request:
branches: [ "main", "develop"]
paths:
- 'backend/**'

env:
java_version: 17
java_distribution: temurin
defaults:
run:
working-directory: ./backend
# run in parallel by default
# can be multiple jobs
# cannot share machines between jobs so either steps or need to check out in each job
jobs:
build: # first job
runs-on: ubuntu-latest # the "worker node" where it's going to be build
steps:
- name: Check out code
uses: actions/checkout@v4.1.7 # action

- name: Set up jdk ${{ env.java_version }}
uses: actions/setup-java@v4
with:
java-version: ${{ env.java_version }}
distribution: ${{ env.java_distribution }}

- name: Setup Gradle
uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0

- name: Build with Gradle
run: ./gradlew build
60 changes: 60 additions & 0 deletions .github/workflows/CI_frontend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# worflow for building the front end

name: "React frotend CI" # the name of the job when ran

# events that will trigger this workflow to run
on:
push:
branches: [ "main", "develop"]
paths: # only trigger if changes in this paths
- 'frontend/**'
pull_request:
branches: [ "main", "develop"]
paths:
- 'frontend/**'
env:
node_version: 22.x
defaults:
run:
working-directory: ./frontend

# run in parallel by default
# can be multiple jobs
# cannot share machines between jobs so either steps or need to check out in each job
jobs:
build: # first job
runs-on: ubuntu-latest # the "worker node" where it's going to be build
steps:
- name: Check out code
uses: actions/checkout@v4.1.7 # action

- name: Use Node.js ${{ env.node_version }}
uses: actions/setup-node@v4.0.3 # action
with:
node-version: ${{ env.node_version }}
cache: 'npm'
cache-dependency-path: './frontend/package-lock.json'

- name: Run npm clean install
run: npm ci

# can have or not a name
- run: npm run build --if-present

# test job
test:
needs: build
runs-on: ubuntu-latest # the "worker node" where it's going to be build
steps:
- name: Check out code
uses: actions/checkout@v4.1.7 # action

- name: Use Node.js ${{ env.node_version }}
uses: actions/setup-node@v4.0.3 # action
with:
node-version: ${{ env.node_version }}
cache: 'npm'
cache-dependency-path: './frontend/package-lock.json'
- name: "Run test on frontend"
run: npm ci
- run: npm test
2 changes: 1 addition & 1 deletion backend/HELP.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Getting Started
# Getting Started with Java and gradle

### Reference Documentation
For further reference, please consider the following sections:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class HelloController {

@GetMapping("/")
public String index() {
return "Greetings from Spring Boot!";
return "Greetings from Spring Boot!!";
}

}
2 changes: 1 addition & 1 deletion frontend/src/App.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { render, screen } from '@testing-library/react';
import App from './App';

test('renders learn react link', () => {
test('renders learn react link in app page', () => {
render(<App />);
const linkElement = screen.getByText(/learn react/i);
expect(linkElement).toBeInTheDocument();
Expand Down
Loading