Ensure provider fields for graph instances #2107
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: | |
core: | |
name: "core artifacts (compiler, runtime, gradle plugin)" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 | |
- 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@v4 | |
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 root project | |
run: ./gradlew check --continue --quiet | |
- name: (Fail-only) Upload reports | |
if: failure() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: reports-build | |
path: | | |
**/build/reports/** | |
samples: | |
name: "samples" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 | |
- 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@v4 | |
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 | |
- name: (Fail-only) Upload reports | |
if: failure() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: reports-samples-${{ runner.os }} | |
path: | | |
**/build/reports/** | |
# 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 }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ ubuntu-latest, windows-latest, macos-latest ] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 | |
- 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@v4 | |
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@v4 | |
with: | |
name: reports-multiplatform-${{ matrix.os }} | |
path: | | |
**/build/reports/** | |
benchmarks: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 | |
- 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@v4 | |
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@v4 | |
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: | |
runs-on: macos-latest | |
if: github.ref == 'refs/heads/main' && github.repository == 'zacsweers/metro' | |
needs: | |
- final-status | |
steps: | |
- name: Checkout | |
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 | |
- 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@v4 | |
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 (main only) | |
env: | |
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SonatypeUsername }} | |
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SonatypePassword }} | |
run: ./metrow publish |