Merge pull request #1967 from microsoftgraph/dependabot/gradle/kiota-… #1624
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Gradle Build and Compare Package | |
on: | |
push: | |
branches: [dev, support/5.x.x] | |
pull_request: | |
branches: [dev, support/5.x.x] | |
paths-ignore: | |
- '.gradle/wrapper' | |
- '.gitignore' | |
- 'LICENSE' | |
- 'THIRD PARTY NOTICES' | |
- '*.md' | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 21 | |
distribution: 'temurin' | |
cache: gradle | |
- name: Detect Secrets | |
uses: RobertFischer/detect-secrets-action@v2.0.0 | |
- name: Grant Execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Build with Gradle | |
run: ./gradlew build | |
- name: Upload Unit Test Results | |
if: ${{ always() }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: UnitTests | |
path: | | |
build/reports/tests/test/** | |
build/test-results/** | |
- name: Upload a Build Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: drop | |
path: | | |
**/libs/* | |
build/generated-pom.xml | |
build/generated-pom.xml.asc | |
build.gradle | |
gradlew | |
gradlew.bat | |
settings.gradle | |
gradle.properties | |
**/gradle/** | |
Scripts/** | |
compare-packages: | |
needs: build | |
runs-on: ubuntu-latest | |
env: | |
CURRENT_PKG_DIFF: ./artifacts/current/build/libs/msgraph-sdk-java.jar | |
PRIOR_PKG_DIFF: ./artifacts/previous/build/libs/msgraph-sdk-java.jar | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 21 | |
distribution: 'temurin' | |
cache: gradle | |
- name: Download Current Build | |
uses: actions/download-artifact@v4 | |
with: | |
name: drop | |
path: artifacts/current/ | |
- name: Download Last Successful Build | |
uses: dawidd6/action-download-artifact@v3.1.4 | |
with: | |
workflow: preview-and-release.yml | |
workflow_conclusion: success | |
branch: dev | |
event: push | |
name: drop | |
path: artifacts/previous/ | |
- name: Run PKG Diff | |
continue-on-error: true | |
run: | | |
sudo apt install pkgdiff | |
pkgdiff -hide-unchanged ${{ env.PRIOR_PKG_DIFF }} ${{ env.CURRENT_PKG_DIFF }} | |
- name: Upload Diff Artifact | |
if: ${{ always() }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: diff | |
path: | | |
./pkgdiff_reports/** |