-
Notifications
You must be signed in to change notification settings - Fork 0
111 lines (90 loc) · 3.09 KB
/
Copy pathci.yml
File metadata and controls
111 lines (90 loc) · 3.09 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
name: CI
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
permissions:
contents: read
id-token: write
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
jobs:
test-and-coverage:
runs-on: ubuntu-latest
timeout-minutes: 90
strategy:
fail-fast: false
matrix:
java: [ '11', '17', '21', '25' ]
env:
DOCKER_HOST: unix:///var/run/docker.sock
TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE: /var/run/docker.sock
TESTCONTAINERS_RYUK_DISABLED: false
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: ${{ matrix.java }}
cache: maven
- name: Verify Docker
run: docker info
- name: Run tests (including Testcontainers)
run: mvn -B clean test -pl flexdblink
- name: Upload JaCoCo XML as artifact
if: always() && matrix.java == '21'
uses: actions/upload-artifact@v7
with:
name: jacoco-report
path: flexdblink/target/site/jacoco/jacoco.xml
if-no-files-found: warn
- name: Upload coverage to Codecov
if: always() && matrix.java == '21'
run: |
set -euo pipefail
auth_token=""
if [ -n "${ACTIONS_ID_TOKEN_REQUEST_URL:-}" ] && [ -n "${ACTIONS_ID_TOKEN_REQUEST_TOKEN:-}" ]; then
oidc_response="$(curl -fsSL -H "Authorization: bearer ${ACTIONS_ID_TOKEN_REQUEST_TOKEN}" "${ACTIONS_ID_TOKEN_REQUEST_URL}&audience=https://codecov.io")"
auth_token="$(echo "${oidc_response}" | jq -r '.value')"
fi
if [ -z "${auth_token}" ] || [ "${auth_token}" = "null" ]; then
echo "::warning::Codecov auth token could not be resolved. Coverage upload is skipped."
exit 0
fi
curl -fsSLo codecov https://cli.codecov.io/latest/linux/codecov
chmod +x codecov
set +e
./codecov --verbose upload-process --disable-search \
-t "${auth_token}" \
-f flexdblink/target/site/jacoco/jacoco.xml \
-F unittests \
-F integration
upload_exit_code=$?
set -e
if [ "${upload_exit_code}" -ne 0 ]; then
echo "::warning::Codecov upload failed with exit code ${upload_exit_code}."
fi
maven-plugin-test:
runs-on: ubuntu-latest
timeout-minutes: 60
needs: test-and-coverage
env:
DOCKER_HOST: unix:///var/run/docker.sock
TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE: /var/run/docker.sock
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Set up JDK 11
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: '11'
cache: maven
- name: Install flexdblink artifact for plugin dependency
run: mvn -B -DskipTests install -pl flexdblink
- name: Run flexdblink-maven-plugin module verify (unit + integration)
run: mvn -B clean verify -pl flexdblink-maven-plugin