-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (40 loc) · 1.47 KB
/
Copy pathtest.yml
File metadata and controls
43 lines (40 loc) · 1.47 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
name: Tests
# Run the test suite (Surefire, all *Test classes) on every PR and push.
# Integration-style tests provision a real PostgreSQL via Testcontainers,
# which uses the Docker daemon built into ubuntu-latest runners.
# No .env file is needed: @ServiceConnection wires the datasource to the
# container and the tests exclude the MongoDB autoconfiguration.
on:
pull_request:
branches: [dev]
push:
branches: [dev, main]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-java@v5
with:
distribution: temurin
java-version: "21"
cache: maven
- name: Run the test suite
run: ./mvnw -B -ntp test
# JaCoCo is bound to the test phase, so the run above already
# produced the coverage report (HTML and XML).
- name: Upload the coverage report
if: always()
uses: actions/upload-artifact@v7
with:
name: jacoco-coverage-report
path: target/site/jacoco/
# Publish coverage to Codecov (ADR-0012). Advisory: codecov.yml sets
# informational statuses, and an upload failure does not fail CI.
- name: Upload coverage to Codecov
# Third-party action, pinned to the commit SHA of v7.0.0
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: target/site/jacoco/jacoco.xml
fail_ci_if_error: false