| name: Python CI |
| |
| on: |
| push: |
| paths-ignore: [ '**/*.html', '**/*.md', '**/*.txt', '**/*.xml', '**/*.yaml', '**/*.yml', '**/LICENSE', '**/NOTICE' ] |
| branches: [ 'main', '[0-9]+.[0-9]+.[Xx]' ] |
| pull_request: |
| paths-ignore: [ '**/*.html', '**/*.md', '**/*.txt', '**/*.xml', '**/*.yaml', '**/*.yml', '**/LICENSE', '**/NOTICE' ] |
| # The branches below must be a subset of the branches above |
| branches: [ 'main', '[0-9]+.[0-9]+.[Xx]' ] |
| workflow_dispatch: |
| |
| jobs: |
| build: |
| name: JDK ${{ matrix.jdk }} - Scala ${{ matrix.scala }} - Spark ${{ matrix.spark }} |
| runs-on: ubuntu-latest |
| |
| strategy: |
| fail-fast: false |
| # using fixed versions for CI; can expand if building wheels for pypi |
| matrix: |
| jdk: [ 11, 17 ] |
| scala: [ 2.12.20 ] |
| spark: [ 3.5.4 ] |
| |
| env: |
| JDK_VERSION: ${{ matrix.jdk }} |
| SCALA_VERSION: ${{ matrix.scala }} |
| SPARK_VERSION: ${{ matrix.spark }} |
| |
| steps: |
| - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )" |
| uses: actions/checkout@v4 |
| with: |
| persist-credentials: false |
| |
| - name: Cache local Maven repository |
| uses: actions/cache@v4 |
| with: |
| path: | |
| ~/.m2/repository |
| ~/.sbt |
| ~/.ivy2 |
| key: ${{ runner.os }}-build-${{ runner.os }}-jdk-${{ matrix.jdk }}-scala-${{ matrix.scala }}-spark-${{ matrix.spark }}-sbt-${{ hashFiles('**/build.sbt') }} |
| restore-keys: ${{ runner.os }}-build-${{ runner.os }}-jdk-${{matrix.jdk}}-scala-${{ matrix.scala }}-spark-${{ matrix.spark }}-sbt- |
| |
| - name: Setup JDK |
| uses: actions/setup-java@v4 |
| with: |
| java-version: ${{ matrix.jdk }} |
| distribution: 'temurin' |
| java-package: jdk |
| architecture: x64 |
| |
| - name: Setup SBT |
| uses: sbt/setup-sbt@v1 |
| |
| - name: Echo config versions |
| run: | |
| java -version |
| echo Scala version: $SCALA_VERSION |
| echo Spark version: $SPARK_VERSION |
| |
| - name: Build Scala package |
| run: > |
| sbt ++$SCALA_VEERSION --batch clean package |
| |
| - name: Set up Python |
| uses: actions/setup-python@v5 |
| with: |
| python-version: '3.12' |
| |
| - name: Install Python dependencies |
| run: | |
| python -m pip install --upgrade pip |
| python -m pip install tox |
| |
| - name: Run Python tests |
| run: | |
| cd python |
| python -m tox |