|
| 1 | +name: Manifest compat |
| 2 | + |
| 3 | +# Reusable: build-tool version compatibility for ONE ecosystem's manifest script. |
| 4 | +# Called by manifest-gradle.yml / manifest-sbt.yml / manifest-maven.yml when their |
| 5 | +# label is added to a PR, so each ecosystem is its own workflow (and its own PR |
| 6 | +# check group). Runs the real script across a version matrix to assert it emits |
| 7 | +# the expected RECORDS (the TS assembler is covered by unit tests). |
| 8 | + |
| 9 | +on: |
| 10 | + workflow_call: |
| 11 | + inputs: |
| 12 | + tool: |
| 13 | + description: gradle | maven | sbt |
| 14 | + required: true |
| 15 | + type: string |
| 16 | + |
| 17 | +permissions: |
| 18 | + contents: read |
| 19 | + |
| 20 | +jobs: |
| 21 | + # The label is a momentary "run" button: remove it as soon as the run starts so |
| 22 | + # re-adding it re-triggers a fresh run (and the PR doesn't stay labeled). |
| 23 | + unlabel: |
| 24 | + runs-on: ubuntu-latest |
| 25 | + permissions: |
| 26 | + pull-requests: write |
| 27 | + steps: |
| 28 | + - env: |
| 29 | + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 30 | + REPO: ${{ github.repository }} |
| 31 | + PR: ${{ github.event.pull_request.number }} |
| 32 | + LABEL: ${{ github.event.label.name }} |
| 33 | + run: gh api --method DELETE "repos/$REPO/issues/$PR/labels/$LABEL" || true |
| 34 | + |
| 35 | + setup: |
| 36 | + runs-on: ubuntu-latest |
| 37 | + outputs: |
| 38 | + matrix: ${{ steps.m.outputs.matrix }} |
| 39 | + steps: |
| 40 | + - id: m |
| 41 | + env: |
| 42 | + TOOL: ${{ inputs.tool }} |
| 43 | + run: | |
| 44 | + if [ "$TOOL" = gradle ]; then |
| 45 | + # 1.12: all three reflective fallbacks; 2.14.1: findProperty/firstLevel; 3.3: native |
| 46 | + # canBeResolved; 8.10.2: modern; 9.2.1: latest. |
| 47 | + matrix='{"include":[{"tool":"gradle","ver":"1.12","java":"8"},{"tool":"gradle","ver":"2.14.1","java":"8"},{"tool":"gradle","ver":"3.3","java":"8"},{"tool":"gradle","ver":"8.10.2","java":"17"},{"tool":"gradle","ver":"9.2.1","java":"21"}]}' |
| 48 | + elif [ "$TOOL" = maven ]; then |
| 49 | + # Runtime compat of the core extension across the Maven 3.6/3.8/3.9 line. |
| 50 | + matrix='{"include":[{"tool":"maven","ver":"3.6.3","java":"11"},{"tool":"maven","ver":"3.8.8","java":"17"},{"tool":"maven","ver":"3.9.9","java":"17"}]}' |
| 51 | + else |
| 52 | + # 0.13.18: Scala 2.10 / reflective 0.13 shims; then 1.x. |
| 53 | + matrix='{"include":[{"tool":"sbt","ver":"0.13.18","scala":"2.10.7","java":"8"},{"tool":"sbt","ver":"1.4.9","scala":"2.12.20","java":"11"},{"tool":"sbt","ver":"1.6.2","scala":"2.12.20","java":"17"},{"tool":"sbt","ver":"1.9.9","scala":"2.12.20","java":"17"}]}' |
| 54 | + fi |
| 55 | + echo "matrix=$matrix" >> "$GITHUB_OUTPUT" |
| 56 | +
|
| 57 | + compat: |
| 58 | + needs: setup |
| 59 | + name: ${{ matrix.tool }} ${{ matrix.ver }} |
| 60 | + runs-on: ubuntu-latest |
| 61 | + strategy: |
| 62 | + fail-fast: false |
| 63 | + matrix: ${{ fromJSON(needs.setup.outputs.matrix) }} |
| 64 | + steps: |
| 65 | + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 66 | + with: |
| 67 | + persist-credentials: false |
| 68 | + - uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1 |
| 69 | + with: |
| 70 | + distribution: 'temurin' |
| 71 | + java-version: ${{ matrix.java }} |
| 72 | + - uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 |
| 73 | + with: |
| 74 | + python-version: '3.12' |
| 75 | + # matrix.* via env (not inlined): the matrix is generated dynamically, so its |
| 76 | + # values are treated as untrusted in run shells. |
| 77 | + - name: Download Gradle ${{ matrix.ver }} |
| 78 | + if: matrix.tool == 'gradle' |
| 79 | + env: |
| 80 | + VER: ${{ matrix.ver }} |
| 81 | + run: | |
| 82 | + curl -fsSL "https://services.gradle.org/distributions/gradle-$VER-bin.zip" -o gradle.zip |
| 83 | + unzip -q gradle.zip |
| 84 | + - name: Gradle smoke test (offline, local repo) |
| 85 | + if: matrix.tool == 'gradle' |
| 86 | + env: |
| 87 | + VER: ${{ matrix.ver }} |
| 88 | + run: bash src/commands/manifest/scripts/test/gradle-compat/smoke-test.sh "$PWD/gradle-$VER/bin/gradle" |
| 89 | + - uses: sbt/setup-sbt@3e125ece5c3e5248e18da9ed8d2cce3d335ec8dd # v1.1.14 |
| 90 | + if: matrix.tool == 'sbt' |
| 91 | + with: |
| 92 | + sbt-runner-version: 1.9.9 |
| 93 | + - name: SBT smoke test (sbt ${{ matrix.ver }}) |
| 94 | + if: matrix.tool == 'sbt' |
| 95 | + env: |
| 96 | + VER: ${{ matrix.ver }} |
| 97 | + SCALA: ${{ matrix.scala }} |
| 98 | + run: bash src/commands/manifest/scripts/test/sbt-compat/smoke-test.sh "$VER" "$SCALA" |
| 99 | + # Build the extension jar from source with the runner's default Maven, then run the smoke project |
| 100 | + # on the matrix Maven version (runtime compat is what varies, not the build). |
| 101 | + - name: Build Maven extension jar |
| 102 | + if: matrix.tool == 'maven' |
| 103 | + run: bash src/commands/manifest/scripts/maven-extension/build-jar.sh |
| 104 | + - name: Download Maven ${{ matrix.ver }} |
| 105 | + if: matrix.tool == 'maven' |
| 106 | + env: |
| 107 | + VER: ${{ matrix.ver }} |
| 108 | + run: | |
| 109 | + curl -fsSL "https://archive.apache.org/dist/maven/maven-3/$VER/binaries/apache-maven-$VER-bin.zip" -o maven.zip |
| 110 | + unzip -q maven.zip |
| 111 | + - name: Maven smoke test (maven ${{ matrix.ver }}) |
| 112 | + if: matrix.tool == 'maven' |
| 113 | + env: |
| 114 | + VER: ${{ matrix.ver }} |
| 115 | + run: | |
| 116 | + bash src/commands/manifest/scripts/test/maven-compat/smoke-test.sh \ |
| 117 | + "$PWD/apache-maven-$VER/bin/mvn" \ |
| 118 | + "$PWD/src/commands/manifest/scripts/maven-extension/coana-maven-extension.jar" |
0 commit comments