-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (44 loc) · 1.52 KB
/
backend.yml
File metadata and controls
55 lines (44 loc) · 1.52 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
name: Backend Lint and Unit Tests
on:
pull_request:
workflow_dispatch:
env:
TEST_COGNITO_JWT_URL: ${{ secrets.TEST_COGNITO_JWT_URL }}
jobs:
lint-backend:
runs-on: ubuntu-latest
container:
image: maven:3.9.9-amazoncorretto-21-alpine
defaults:
run:
working-directory: ./backend/application/
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Run backend linting (Checkstyle)
run: |
echo "Running backend linting..."
mvn -f ./backendService/pom.xml clean checkstyle:check
echo "Backend linting passed"
unit-test-backend:
runs-on: ubuntu-latest
needs: lint-backend
container:
image: maven:3.9.9-amazoncorretto-21-alpine
defaults:
run:
working-directory: ./backend/application/
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Prepare application.yml for tests
run: |
echo "Copying the test-application.yml into a application.yml file..."
cp ./backendService/src/main/resources/test-application.example.yml ./backendService/src/main/resources/application.yml
cp ./backendService/src/test/resources/application.example.yml ./backendService/src/test/resources/application.yml
echo "Copying completed"
- name: Run unit tests
run: |
echo "Running unit tests..."
mvn -f ./backendService/pom.xml clean test -DTEST_COGNITO_JWT_URL=$TEST_COGNITO_JWT_URL
echo "Unit tests passed"