Skip to content

Merge pull request #22 from y-ok/release/0.2.6 #84

Merge pull request #22 from y-ok/release/0.2.6

Merge pull request #22 from y-ok/release/0.2.6 #84

Workflow file for this run

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