From 5a75d8f64e85fd8ab8cb692206b035065f4af89e Mon Sep 17 00:00:00 2001 From: Martin Mauch Date: Mon, 30 Dec 2024 23:54:36 +0100 Subject: [PATCH] build: Read build matrix from Mill --- .github/workflows/ci.yml | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a43a91db..19bb4108 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,23 +16,28 @@ env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} jobs: + prepare: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Generate matrix + id: set-matrix + run: | + echo -n "matrix=" >> $GITHUB_OUTPUT + ./mill resolve "spark-excel[_,_]" | \ + jq -Rsc 'split("\n") | map(capture("spark-excel\\[(?[^,]+),(?[^\\]]+)\\]") | select(.)) | {include: .}' >> $GITHUB_OUTPUT + build: + needs: prepare name: Build and Test strategy: fail-fast: false - matrix: - os: [ubuntu-latest] - scala: [2.12.20, 2.13.15] - java: [temurin@11] - spark: [2.4.8, 3.0.3, 3.1.3, 3.2.4, 3.3.4, 3.4.4, 3.5.3] - exclude: - - spark: 2.4.8 - scala: 2.13.15 - - spark: 3.0.3 - scala: 2.13.15 - - spark: 3.1.3 - scala: 2.13.15 - runs-on: ${{ matrix.os }} + matrix: ${{ fromJson(needs.prepare.outputs.matrix) }} + runs-on: ubuntu-latest steps: - name: Checkout current branch (full) uses: actions/checkout@v4