Skip to content

Merge pull request #1396 from microsoftgraph/release-please--branches… #2481

Merge pull request #1396 from microsoftgraph/release-please--branches…

Merge pull request #1396 from microsoftgraph/release-please--branches… #2481

name: "Checks the SDK only using APIs from the targeted API level"
on:
workflow_dispatch:
push:
branches: [main, support/5.x.x]
pull_request:
branches: [main, support/5.x.x]
jobs:
lint-api-level:
runs-on: [self-hosted, 1ES.Pool=1es-ubuntu-msgraph-beta-sdk-java-mem-lates-m]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5.7.0
with:
distribution: 'temurin'
java-version: 21
cache: gradle
- name: Move generated sources to correct package
run: .\scripts\copyFilesOnBuild.ps1 -inputPath '.\src\main\java\com\microsoft\graph\beta\generated'
shell: pwsh
- name: Setup Android SDK
uses: android-actions/setup-android@40fd30fb8d7440372e1316f5d1809ec01dcd3699 # v4.0.1
with:
packages: 'platform-tools'
- name: Add execution right to the script
run: chmod +x gradlew
working-directory: ./android
- name: Build SDK with Android project configuration
id: lint
run: ./gradlew --no-daemon build
working-directory: ./android
- name: Upload linting results
if: failure() && steps.lint.outcome == 'failure'
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: lint-report
path: ./android/build/reports