-
Notifications
You must be signed in to change notification settings - Fork 0
91 lines (81 loc) · 2.75 KB
/
Copy pathbackend_tests.yml
File metadata and controls
91 lines (81 loc) · 2.75 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
86
87
88
89
90
91
name: "Backend Tests"
run-name: "Backend Tests on ${{ github.ref_name }} by @${{ github.actor }}"
on:
pull_request:
paths:
- "apps/opik-backend/**"
- ".github/workflows/backend_tests.yml"
- ".github/scripts/discover-backend-tests.sh"
push:
branches:
- 'main'
paths:
- "apps/opik-backend/**"
- ".github/workflows/backend_tests.yml"
- ".github/scripts/discover-backend-tests.sh"
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
permissions:
contents: read
checks: write
pull-requests: write
jobs:
# Automatically classify tests as unit/integration and split integration
# tests into balanced groups. No manual maintenance when adding new tests.
discover-tests:
runs-on: ubuntu-latest
timeout-minutes: 2
outputs:
matrix: ${{ steps.split.outputs.matrix }}
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 1
sparse-checkout: |
apps/opik-backend/src/test/java
.github/scripts
- name: Classify and split tests
id: split
working-directory: apps/opik-backend
run: ../../.github/scripts/discover-backend-tests.sh
run-backend-tests:
needs: discover-tests
name: ${{ matrix.name }}
runs-on: ubuntu-latest
timeout-minutes: ${{ matrix.timeout }}
defaults:
run:
working-directory: apps/opik-backend/
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.discover-tests.outputs.matrix) }}
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 1
- name: Set up JDK 25
uses: actions/setup-java@v4
with:
java-version: '25'
distribution: 'corretto'
cache: maven
- name: Run ${{ matrix.name }}
env:
TESTCONTAINERS_REUSE_ENABLE: true
run: >-
mvn clean test
-Dtest="${{ matrix.tests }}"
-Dmaven.test.failure.ignore=true
-Dsurefire.rerunFailingTestsCount=3
- name: Publish Test Report
uses: EnricoMi/publish-unit-test-result-action/linux@v2
if: always()
with:
action_fail: true
comment_mode: failures
check_name: "Backend Tests - ${{ matrix.name }}"
files: '**/target/surefire-reports/TEST-*.xml'