Skip to content

Commit

Permalink
Check binary compatibility with earlier release version
Browse files Browse the repository at this point in the history
  • Loading branch information
EnricoMi committed Aug 1, 2023
1 parent a1f7aa6 commit c7938ec
Show file tree
Hide file tree
Showing 3 changed files with 126 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/actions/check-compat/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: 'Check'
author: 'EnricoMi'
description: 'A GitHub Action that checks compatibility of spark-extension'

inputs:
spark-compat-version:
description: Spark compatibility version, e.g. 3.4
required: true
scala-compat-version:
description: Scala compatibility version, e.g. 2.12
required: true
package-version:
description: Spark-Extension version to check against
required: true

runs:
using: 'composite'
steps:
- name: Setup JDK 1.8
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'zulu'

- name: Install Checker
run: apt install japi-compliance-checker
shell: bash

- name: Fetch package
run: |
mvn dependency:get -DremoteRepositories -Dartifact=uk.co.gresearch.spark:spark-extension_${{ inputs.scala-compat-version }}:${{ inputs.package-version }}-${{ inputs.spark-compat-version }}
shell: bash

- name: Check
run: japi-compliance-checker ~/.m2/repository/uk/co/gresearch/spark/spark-extension_${{ inputs.scala-compat-version }}/${{ inputs.package-version }}-${{ inputs.spark-compat-version }}/spark-extension_${{ inputs.scala-compat-version }}-${{ inputs.package-version }}-${{ inputs.spark-compat-version }}.jar target/spark-extension*.jar
shell: bash

- name: Upload Report
uses: actions/upload-artifact@v3
with:
name: Compat-Report-${{ inputs.spark-compat-version }}-${{ inputs.scala-compat-version }}
path: compat_reports/spark-extension/*

branding:
icon: 'check-circle'
color: 'green'
76 changes: 76 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Check

on:
workflow_call:
inputs:
package-version:
required: true
type: string
jobs:
config:
name: Configure check
runs-on: ubuntu-latest
outputs:
major-version: ${{ steps.versions.outputs.major-version }}
latest-release-version: ${{ steps.versions.outputs.latest-release-version }}
latest-release-major-version: ${{ steps.versions.outputs.latest-release-major-version }}

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Get versions
id: versions
run: |
version=$(grep -m1 version pom.xml | sed -e "s/<[^>]*>//g" -e "s/ //g")
echo "version=$release_version" >> "$GITHUB_OUTPUT"
echo "major-version=${release_version/.*/}" >> "$GITHUB_OUTPUT"
release_version=$(git tag | tail -n1 | sed "s/^v//")
echo "latest-release-version=$release_version" >> "$GITHUB_OUTPUT"
echo "latest-release-major-version=${release_version/.*/}" >> "$GITHUB_OUTPUT"
shell: bash

check:
name: Check (Spark ${{ matrix.spark-compat-version }} Scala ${{ matrix.scala-version }})
needs: config
runs-on: ubuntu-latest
if: needs.config.outputs.major-version == needs.config.outputs.latest-release-major-version

strategy:
fail-fast: false
matrix:
include:
- spark-compat-version: '3.0'
scala-compat-version: '2.12'
- spark-compat-version: '3.1'
scala-compat-version: '2.12'
- spark-compat-version: '3.2'
scala-compat-version: '2.12'
- spark-compat-version: '3.3'
scala-compat-version: '2.12'
- spark-compat-version: '3.4'
scala-compat-version: '2.12'
- spark-compat-version: '3.5'
scala-compat-version: '2.12'

- spark-compat-version: '3.2'
scala-compat-version: '2.13'
- spark-compat-version: '3.3'
scala-compat-version: '2.13'
- spark-compat-version: '3.4'
scala-compat-version: '2.13'
- spark-compat-version: '3.5'
scala-compat-version: '2.12'

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Check
uses: ./.github/actions/check-compat
with:
spark-compat-version: ${{ matrix.spark-compat-version }}
scala-version: ${{ matrix.scala-version }}
spark-compat-version: ${{ matrix.spark-compat-version }}
package-version: ${{ needs.config.outputs.latest-release-version }}
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ jobs:
name: "Test Snapshots"
needs: build-snapshots
uses: "./.github/workflows/test-snapshots.yml"
check:
name: "Check"
needs: [build-jvm, build-snapshots]
uses: "./.github/workflows/check.yml"

test_success:
name: "Test success"
Expand Down

0 comments on commit c7938ec

Please sign in to comment.