Skip to content

Commit

Permalink
build: Read build matrix from Mill
Browse files Browse the repository at this point in the history
  • Loading branch information
nightscape committed Dec 30, 2024
1 parent 6866cb1 commit 6aa02fd
Showing 1 changed file with 18 additions and 15 deletions.
33 changes: 18 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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\\[(?<scala>[^,]+),(?<spark>[^\\]]+)\\]") | 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
Expand All @@ -41,14 +46,12 @@ jobs:

- name: Download Java (temurin@11)
id: download-java-temurin-11
if: matrix.java == 'temurin@11'
uses: typelevel/download-java@v2
with:
distribution: temurin
java-version: 11

- name: Setup Java (temurin@11)
if: matrix.java == 'temurin@11'
uses: actions/setup-java@v4
with:
distribution: jdkfile
Expand Down

0 comments on commit 6aa02fd

Please sign in to comment.