-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (73 loc) · 2.29 KB
/
tests.yml
File metadata and controls
85 lines (73 loc) · 2.29 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: Run Tests
on:
push:
branches: [ main, develop, backend ]
pull_request:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: 'maven'
- name: Cache Maven dependencies
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Start Docker (for Testcontainers)
run: |
echo "Docker is available for Testcontainers"
docker --version
- name: Run all tests with Testcontainers
run: mvn clean test -Dspring.profiles.active=test
env:
# Redis configuration (dummy values for tests that don't use Redis)
REDIS_URL: localhost
REDIS_PORT: 6379
REDIS_USERNAME: ""
REDIS_PASSWORD: ""
# Cognito OAuth2 configuration (dummy values for tests)
COGNITO_ISSUER: https://dummy-issuer.com
COGNITO_TOKEN_SIGNING_KEY_URL: https://dummy-issuer.com/.well-known/jwks.json
COGNITO_DOMAIN: dummy-domain
AWS_REGION: us-east-1
COGNITO_CLIENT_ID: dummy-client-id
WITS_USERNAME: test-username
WITS_PASSWORD: test-password
# Database configuration (Testcontainers will handle this)
# The test profile uses Testcontainers with PostgreSQL
SPRING_PROFILES_ACTIVE: test
- name: Generate test coverage report
run: mvn jacoco:report
continue-on-error: true
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results
path: |
target/surefire-reports/
target/site/jacoco/
retention-days: 30
- name: Upload coverage reports
uses: actions/upload-artifact@v4
if: success()
with:
name: coverage-report
path: target/site/jacoco/
retention-days: 30
- name: Test Summary
uses: test-summary/action@v2
if: always()
with:
paths: target/surefire-reports/*.xml