diff --git a/.github/workflows/dyn-matrices.yml b/.github/workflows/dyn-matrices.yml new file mode 100644 index 00000000..bd9cb10c --- /dev/null +++ b/.github/workflows/dyn-matrices.yml @@ -0,0 +1,32 @@ +name: Dynamic Matrices +on: + push: + pull_request: + types: [ assigned, opened, synchronize, reopened, edited ] + workflow_dispatch: + +jobs: + prepare: + runs-on: ubuntu-20.04 + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} + steps: + - uses: actions/checkout@v4 + with: + sparse-checkout: | + pom.xml + sparse-checkout-cone-mode: false + - id: set-matrix + run: | + slack_pl_version=$(cat ./pom.xml | grep -oE -m 1 '[0-9][0-9]?\.[0-9]+\.[0-9]+' | grep -oE '[0-9]\.[0-9]+\.[0-9]+') + echo "Slack Plugin Version $slack_pl_version" + echo "matrix={\"java-version\":[\"8\",\"11\",\"17\"],\"bitbucket-version\":[\"7.6.0\",\"8.8.0\"],\"exclude\":[{\"java-version\":\"17\",\"bitbucket-version\":\"7.6.0\"}]}" >> $GITHUB_OUTPUT + + run-tests: + needs: prepare + runs-on: ubuntu-20.04 + strategy: + matrix: ${{ fromJSON(needs.prepare.outputs.matrix) }} + fail-fast: false + steps: + - run: echo "Matrix - Java ${{ matrix.java-version }}, Bitbucket ${{ matrix.bitbucket-version }}"