Fix gradle wrapper jars + execs #3265
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: CI | |
| on: | |
| # Only run push on main | |
| push: | |
| branches: | |
| - main | |
| paths-ignore: | |
| - '**/*.md' | |
| # Always run on PRs | |
| pull_request: | |
| concurrency: | |
| group: 'ci-${{ github.event.merge_group.head_ref || github.head_ref }}-${{ github.workflow }}' | |
| cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | |
| jobs: | |
| generate-matrix: | |
| name: "⊹ generate compiler matrix ⊹" | |
| runs-on: ubuntu-latest | |
| outputs: | |
| matrix: ${{ steps.generate.outputs.matrix }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 | |
| - name: Generate matrix | |
| id: generate | |
| run: ./scripts/generate-ci-matrix.sh | |
| core: | |
| name: "core artifacts / ${{ matrix.kotlin-compiler }}" | |
| runs-on: ubuntu-latest | |
| needs: generate-matrix | |
| strategy: | |
| matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix) }} | |
| fail-fast: false | |
| permissions: | |
| checks: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 | |
| - name: Configure JDK | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: 'zulu' | |
| java-version-file: .github/workflows/.java-version | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v5 | |
| with: | |
| # Only save Gradle User Home state for builds on the 'main' branch. | |
| # Builds on other branches will only read existing entries from the cache. | |
| cache-read-only: ${{ github.ref != 'refs/heads/main' }} | |
| # Don't reuse cache entries from any other Job. | |
| gradle-home-cache-strict-match: true | |
| cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }} | |
| - name: Cache konan | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.konan/cache | |
| ~/.konan/dependencies | |
| ~/.konan/kotlin-native-macos* | |
| ~/.konan/kotlin-native-mingw* | |
| ~/.konan/kotlin-native-windows* | |
| ~/.konan/kotlin-native-linux* | |
| ~/.konan/kotlin-native-prebuilt-macos* | |
| ~/.konan/kotlin-native-prebuilt-mingw* | |
| ~/.konan/kotlin-native-prebuilt-windows* | |
| ~/.konan/kotlin-native-prebuilt-linux* | |
| key: ${{ runner.os }}-${{ matrix.kotlin-compiler }}-konan-${{ hashFiles('**/*.gradle*') }} | |
| restore-keys: | | |
| ${{ runner.os }}-${{ matrix.kotlin-compiler }}-konan- | |
| - name: Check root project | |
| run: | | |
| # Regenerate tests per-run on CI to support exclusions, which are unfortunately code-gen level right now | |
| echo "Generating tests..." | |
| ./gradlew :compiler-tests:generateTests --quiet '-Pmetro.testCompilerVersion=${{ matrix.kotlin-compiler }}' ${{ github.ref != 'refs/heads/main' && '-Dorg.gradle.configuration-cache.read-only=true' || '' }} | |
| echo "Running checks..." | |
| ./gradlew check --continue --quiet '-Pmetro.testCompilerVersion=${{ matrix.kotlin-compiler }}' ${{ github.ref != 'refs/heads/main' && '-Dorg.gradle.configuration-cache.read-only=true' || '' }} | |
| echo "Running sharding tests..." | |
| ./gradlew :compiler-tests:test --tests '*Sharding.testLargeGraphStressTest' --quiet '-Pmetro.enableShardTest' '-Pmetro.testCompilerVersion=${{ matrix.kotlin-compiler }}' ${{ github.ref != 'refs/heads/main' && '-Dorg.gradle.configuration-cache.read-only=true' || '' }} | |
| - name: (Fail-only) Upload reports | |
| if: failure() | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: reports-core-${{ matrix.kotlin-compiler }} | |
| path: | | |
| **/build/reports/** | |
| - name: Publish Test Report | |
| uses: mikepenz/action-junit-report@v6 | |
| if: failure() | |
| with: | |
| report_paths: '**/build/test-results/**/TEST-*.xml' | |
| check_name: 'Test Report - core / ${{ matrix.kotlin-compiler }}' | |
| samples: | |
| name: "samples" | |
| runs-on: ubuntu-latest | |
| permissions: | |
| checks: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 | |
| - name: Configure JDK | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: 'zulu' | |
| java-version-file: .github/workflows/.java-version | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v5 | |
| with: | |
| # Only save Gradle User Home state for builds on the 'main' branch. | |
| # Builds on other branches will only read existing entries from the cache. | |
| cache-read-only: ${{ github.ref != 'refs/heads/main' }} | |
| # Don't reuse cache entries from any other Job. | |
| gradle-home-cache-strict-match: true | |
| cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }} | |
| - name: Cache konan | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.konan/cache | |
| ~/.konan/dependencies | |
| ~/.konan/kotlin-native-macos* | |
| ~/.konan/kotlin-native-mingw* | |
| ~/.konan/kotlin-native-windows* | |
| ~/.konan/kotlin-native-linux* | |
| ~/.konan/kotlin-native-prebuilt-macos* | |
| ~/.konan/kotlin-native-prebuilt-mingw* | |
| ~/.konan/kotlin-native-prebuilt-windows* | |
| ~/.konan/kotlin-native-prebuilt-linux* | |
| key: ${{ runner.os }}-konan-${{ hashFiles('**/*.gradle*') }} | |
| restore-keys: | | |
| ${{ runner.os }}-konan- | |
| - name: Check samples | |
| run: ./gradlew -p samples check --continue --quiet ${{ github.ref != 'refs/heads/main' && '-Dorg.gradle.configuration-cache.read-only=true' || '' }} | |
| - name: (Fail-only) Upload reports | |
| if: failure() | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: reports-samples-${{ runner.os }} | |
| path: | | |
| **/build/reports/** | |
| - name: Publish Test Report | |
| uses: mikepenz/action-junit-report@v6 | |
| if: failure() | |
| with: | |
| report_paths: 'samples/**/build/test-results/**/TEST-*.xml' | |
| check_name: 'Test Report - samples' | |
| # Runt multiplatform tests on main only to reduce PR time | |
| multiplatform-tests: | |
| name: "multiplatform / ${{ matrix.os }}" | |
| if: ${{ github.ref == 'refs/heads/main' }} | |
| runs-on: ${{ matrix.os }} | |
| permissions: | |
| checks: write | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ ubuntu-latest, windows-latest, macos-latest ] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 | |
| - name: Configure JDK | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: 'zulu' | |
| java-version-file: .github/workflows/.java-version | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v5 | |
| with: | |
| # Only save Gradle User Home state for builds on the 'main' branch. | |
| # Builds on other branches will only read existing entries from the cache. | |
| cache-read-only: ${{ github.ref != 'refs/heads/main' }} | |
| # Don't reuse cache entries from any other Job. | |
| gradle-home-cache-strict-match: true | |
| cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }} | |
| - name: Cache konan | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.konan/cache | |
| ~/.konan/dependencies | |
| ~/.konan/kotlin-native-macos* | |
| ~/.konan/kotlin-native-mingw* | |
| ~/.konan/kotlin-native-windows* | |
| ~/.konan/kotlin-native-linux* | |
| ~/.konan/kotlin-native-prebuilt-macos* | |
| ~/.konan/kotlin-native-prebuilt-mingw* | |
| ~/.konan/kotlin-native-prebuilt-windows* | |
| ~/.konan/kotlin-native-prebuilt-linux* | |
| key: ${{ runner.os }}-konan-${{ hashFiles('**/*.gradle*') }} | |
| restore-keys: | | |
| ${{ runner.os }}-konan- | |
| - name: Check runtime and IC tests | |
| run: ./gradlew :runtime:allTests :gradle-plugin:functionalTest --continue --quiet | |
| - name: Check samples | |
| run: ./gradlew -p samples test allTests --continue --quiet | |
| - name: (Fail-only) Upload reports | |
| if: failure() | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: reports-multiplatform-${{ matrix.os }} | |
| path: | | |
| **/build/reports/** | |
| - name: Publish Test Report | |
| uses: mikepenz/action-junit-report@v6 | |
| if: failure() | |
| with: | |
| report_paths: | | |
| **/build/test-results/**/TEST-*.xml | |
| samples/**/build/test-results/**/TEST-*.xml | |
| check_name: 'Test Report - multiplatform / ${{ matrix.os }}' | |
| benchmarks: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 | |
| - name: Configure JDK | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: 'zulu' | |
| java-version-file: .github/workflows/.java-version | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v5 | |
| with: | |
| # Only save Gradle User Home state for builds on the 'main' branch. | |
| # Builds on other branches will only read existing entries from the cache. | |
| cache-read-only: ${{ github.ref != 'refs/heads/main' }} | |
| # Don't reuse cache entries from any other Job. | |
| gradle-home-cache-strict-match: true | |
| cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }} | |
| - name: Cache konan | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.konan/cache | |
| ~/.konan/dependencies | |
| ~/.konan/kotlin-native-macos* | |
| ~/.konan/kotlin-native-mingw* | |
| ~/.konan/kotlin-native-windows* | |
| ~/.konan/kotlin-native-linux* | |
| ~/.konan/kotlin-native-prebuilt-macos* | |
| ~/.konan/kotlin-native-prebuilt-mingw* | |
| ~/.konan/kotlin-native-prebuilt-windows* | |
| ~/.konan/kotlin-native-prebuilt-linux* | |
| key: ${{ runner.os }}-konan-${{ hashFiles('**/*.gradle*') }} | |
| restore-keys: | | |
| ${{ runner.os }}-konan- | |
| - name: Build Metro benchmark | |
| run: | | |
| cd benchmark | |
| ./run_benchmarks.sh metro --build-only | |
| - name: (Fail-only) Upload reports | |
| if: failure() | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: reports-benchmarks | |
| path: | | |
| **/build/reports/** | |
| # https://jakewharton.com/fan-in-to-a-single-required-github-action/ | |
| final-status: | |
| if: always() | |
| runs-on: ubuntu-latest | |
| needs: | |
| - core | |
| - benchmarks | |
| - samples | |
| steps: | |
| - name: Check | |
| run: | | |
| results=$(tr -d '\n' <<< '${{ toJSON(needs.*.result) }}') | |
| if ! grep -q -v -E '(failure|cancelled)' <<< "$results"; then | |
| echo "One or more required jobs failed" | |
| exit 1 | |
| fi | |
| publish: | |
| name: Publish snapshot (main only) | |
| runs-on: macos-latest | |
| if: github.ref == 'refs/heads/main' && github.repository == 'zacsweers/metro' | |
| needs: | |
| - final-status | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 | |
| - name: Configure JDK | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: 'zulu' | |
| java-version-file: .github/workflows/.java-version | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v5 | |
| with: | |
| # Only save Gradle User Home state for builds on the 'main' branch. | |
| # Builds on other branches will only read existing entries from the cache. | |
| cache-read-only: ${{ github.ref != 'refs/heads/main' }} | |
| # Don't reuse cache entries from any other Job. | |
| gradle-home-cache-strict-match: true | |
| cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }} | |
| - name: Cache konan | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.konan/cache | |
| ~/.konan/dependencies | |
| ~/.konan/kotlin-native-macos* | |
| ~/.konan/kotlin-native-mingw* | |
| ~/.konan/kotlin-native-windows* | |
| ~/.konan/kotlin-native-linux* | |
| ~/.konan/kotlin-native-prebuilt-macos* | |
| ~/.konan/kotlin-native-prebuilt-mingw* | |
| ~/.konan/kotlin-native-prebuilt-windows* | |
| ~/.konan/kotlin-native-prebuilt-linux* | |
| key: ${{ runner.os }}-konan-${{ hashFiles('**/*.gradle*') }} | |
| restore-keys: | | |
| ${{ runner.os }}-konan- | |
| - name: Upload snapshot | |
| # Sonatype keeps giving 429 errors lately, so no need to mark this as failure for now | |
| continue-on-error: true | |
| env: | |
| ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SonatypeUsername }} | |
| ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SonatypePassword }} | |
| run: ./metrow publish |