Add Contract annotation to nullaway-annotations #4345
Workflow file for this run
This file contains hidden or 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: Continuous integration | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - master | |
| concurrency: | |
| group: ${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| name: "Build and test on ${{ matrix.os }}" | |
| strategy: | |
| matrix: | |
| include: | |
| - os: macos-latest | |
| - os: windows-latest | |
| - os: ubuntu-latest | |
| fail-fast: false | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Check out NullAway sources | |
| uses: actions/checkout@v6 | |
| - name: 'Set up JDK 27 EA from jdk.java.net' | |
| uses: oracle-actions/setup-java@v1 | |
| with: | |
| website: jdk.java.net | |
| release: 27 | |
| - name: 'Set up JDKs' | |
| uses: actions/setup-java@v5 | |
| with: | |
| java-version: | | |
| 17 | |
| 21 | |
| 25 | |
| distribution: 'temurin' | |
| check-latest: 'true' | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v5 | |
| - name: List toolchains | |
| run: ./gradlew javaToolchains | |
| - name: Build and test | |
| run: ./gradlew build | |
| - name: Run shellcheck | |
| run: ./gradlew shellcheck | |
| if: runner.os == 'Linux' | |
| - name: Aggregate jacoco coverage | |
| id: jacoco_report | |
| run: ./gradlew codeCoverageReport | |
| continue-on-error: true | |
| if: runner.os == 'Linux' && github.repository == 'uber/NullAway' | |
| - name: Upload coverage reports to Codecov | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| files: ./code-coverage-report/build/reports/jacoco/codeCoverageReport/codeCoverageReport.xml | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| if: steps.jacoco_report.outcome == 'success' | |
| - name: Cleanup Codecov temporary files | |
| run: | | |
| # See https://github.com/codecov/codecov-action/issues/1851 | |
| rm -rf codecov codecov.SHA256SUM codecov.SHA256SUM.sig | |
| if: steps.jacoco_report.outcome == 'success' | |
| - name: Test publishToMavenLocal flow | |
| env: | |
| ORG_GRADLE_PROJECT_VERSION_NAME: '0.0.0.1-LOCAL' | |
| ORG_GRADLE_PROJECT_RELEASE_SIGNING_ENABLED: 'false' | |
| run: ./gradlew publishToMavenLocal | |
| - name: Check that Git tree is clean after build and test | |
| run: ./.buildscript/check_git_clean.sh | |
| test-with-error-prone-snapshot: | |
| name: "Test with Error Prone snapshot" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout this repository | |
| uses: actions/checkout@v6 | |
| - name: 'Set up Default JDK' | |
| uses: actions/setup-java@v5 | |
| with: | |
| java-version: 25 | |
| distribution: 'temurin' | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v5 | |
| - name: Test with Error Prone snapshot | |
| run: ./gradlew testErrorProneLatestSnapshot | |
| compile-other-projects: | |
| name: "Build ${{ matrix.project }} with snapshot" | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - project: caffeine | |
| url: https://github.com/ben-manes/caffeine.git | |
| - project: spring-framework | |
| url: https://github.com/spring-projects/spring-framework.git | |
| - project: junit-framework | |
| url: https://github.com/junit-team/junit-framework.git | |
| - project: spring-boot | |
| url: https://github.com/spring-projects/spring-boot.git | |
| permissions: | |
| contents: read | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout this repository | |
| uses: actions/checkout@v6 | |
| - name: 'Set up JDKs' | |
| uses: actions/setup-java@v5 | |
| with: | |
| java-version: 25 | |
| distribution: 'temurin' | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v5 | |
| - name: Publish to Maven Local | |
| env: | |
| ORG_GRADLE_PROJECT_RELEASE_SIGNING_ENABLED: 'false' | |
| run: ./gradlew publishToMavenLocal | |
| - name: Create a temporary directory for ${{ matrix.project }} | |
| run: mkdir -p /tmp/${{ matrix.project }} | |
| - name: Clone ${{ matrix.project }} repository | |
| run: git clone --depth 1 ${{ matrix.url }} /tmp/${{ matrix.project }} | |
| - name: Run ${{ matrix.project }} build | |
| run: | | |
| cp .github/workflows/use-snapshot.gradle.kts /tmp/${{ matrix.project }} | |
| cd /tmp/${{ matrix.project }} | |
| ./gradlew --init-script use-snapshot.gradle.kts assemble |