|
name: CI |
|
|
|
on: [push, pull_request] |
|
|
|
permissions: |
|
contents: read |
|
|
|
env: |
|
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} |
|
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} |
|
MAVEN_ARGS: -V -B --no-transfer-progress -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 |
|
|
|
jobs: |
|
test_jdk: |
|
strategy: |
|
fail-fast: false |
|
matrix: |
|
java: [21, 25, 26] |
|
name: 'Linux JDK ${{ matrix.java }}' |
|
runs-on: ubuntu-latest |
|
steps: |
|
- name: 'Checkout' |
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
|
- name: 'Set up JDK' |
|
uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95 # v5.6.0 |
|
with: |
|
distribution: 'zulu' |
|
java-version: ${{ matrix.java }} |
|
- name: 'Test' |
|
run: ./mvnw ${MAVEN_ARGS} -Djacoco.skip=${{ matrix.java != 21 }} install -DskipDistribution=${{ matrix.java != 21 }} |
|
- name: 'Generate coverage report' |
|
if: matrix.java == 21 |
|
run: ./mvnw jacoco:report |
|
- name: 'Upload coverage to Codecov' |
|
if: matrix.java == 21 && github.repository == 'mapstruct/mapstruct' |
|
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0 |
|
with: |
|
fail_ci_if_error: true |
|
token: ${{ secrets.CODECOV_TOKEN }} |
|
- name: 'Publish Snapshots' |
|
if: matrix.java == 21 && github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository == 'mapstruct/mapstruct' |
|
run: ./mvnw -s etc/ci-settings.xml -DskipTests=true -DskipDistribution=true deploy |
|
integration_test_jdk: |
|
strategy: |
|
fail-fast: false |
|
matrix: |
|
java: [ 8, 17 ] |
|
name: 'Linux JDK ${{ matrix.java }}' |
|
runs-on: ubuntu-latest |
|
steps: |
|
- name: 'Checkout' |
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
|
- name: 'Set up JDK 21 for building everything' |
|
uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95 # v5.6.0 |
|
with: |
|
distribution: 'zulu' |
|
java-version: 21 |
|
- name: 'Install Processor' |
|
run: ./mvnw ${MAVEN_ARGS} -DskipTests install -pl processor -am |
|
- name: 'Set up JDK ${{ matrix.java }} for running integration tests' |
|
uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95 # v5.6.0 |
|
with: |
|
distribution: 'zulu' |
|
java-version: ${{ matrix.java }} |
|
- name: 'Run integration tests' |
|
run: ./mvnw ${MAVEN_ARGS} verify -pl integrationtest |