-
Notifications
You must be signed in to change notification settings - Fork 1
52 lines (45 loc) · 1.55 KB
/
ci.yml
File metadata and controls
52 lines (45 loc) · 1.55 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
# This is the name of the GitHub Actions workflow.
name: Java and Node.js CI
# This workflow will run on every push to the 'main' branch.
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel.
jobs:
# This job is named 'build-and-test'
build-and-test:
# The type of runner that the job will run on
runs-on: ubuntu-latest
steps:
# Step 1: Checks out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout code
uses: actions/checkout@v3
# Step 2: Set up the Java environment (JDK 21) for the backend tests
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'temurin'
cache: maven
# Step 3: Run the backend Maven tests
- name: Run backend tests
# We need to give execution permissions to the mvnw script first
run: |
chmod +x backend/mvnw
cd backend
./mvnw test
# Step 4: Set up the Node.js environment for the frontend tests
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '16'
cache: 'npm'
cache-dependency-path: frontend/package-lock.json
# Step 5: Install frontend dependencies and run frontend tests
- name: Install dependencies and run frontend tests
run: |
cd frontend
npm install
npm test -- --watchAll=false