Forge: add Incus VM runner spec #4458
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
| # Per-PR gate for build-logic changes: builds the affected-coordinate matrix with | |
| # generateInfrastructureChangedCoordinatesMatrix (§TCK-test-harness.7) and runs the test lane. | |
| # §CI-test-changed-infrastructure; the CI counterpart of §E2E-infrastructure-tests. | |
| name: "Test changed build logic" | |
| on: | |
| pull_request: | |
| branches: | |
| - master | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: "workflow = ${{ github.workflow }}, ref = ${{ github.event.ref }}, pr = ${{ github.event.pull_request.id }}" | |
| cancel-in-progress: true | |
| jobs: | |
| get-changed-infrastructure: | |
| name: "📋 Get a list of libraries to test for build-logic changes" | |
| runs-on: "ubuntu-22.04" | |
| timeout-minutes: 5 | |
| outputs: | |
| matrix: ${{ steps.set-matrix.outputs.matrix }} | |
| none-found: ${{ steps.set-matrix.outputs.none-found }} | |
| relevant-files-changed: ${{ steps.filter.outputs.changed }} | |
| steps: | |
| - name: "☁️ Checkout repository" | |
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: "🔎 Detect relevant file changes" | |
| id: filter | |
| uses: ./.github/actions/detect-file-changes | |
| with: | |
| file-patterns: | | |
| - 'tests/tck-build-logic/**' | |
| - 'gradle/**' | |
| - 'build.gradle' | |
| - 'settings.gradle' | |
| - 'gradle.properties' | |
| - name: "🔧 Setup java" | |
| if: steps.filter.outputs.changed == 'true' | |
| uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4 | |
| with: | |
| distribution: 'graalvm' | |
| java-version: '25' | |
| - name: "🕸️ Populate matrix" | |
| id: set-matrix | |
| if: steps.filter.outputs.changed == 'true' | |
| run: | | |
| ./gradlew generateInfrastructureChangedCoordinatesMatrix -PbaseCommit=${{ github.event.pull_request.base.sha }} -PnewCommit=${{ github.event.pull_request.head.sha }} | |
| test-changed-infrastructure: | |
| name: "🧪 ${{ matrix.coordinates }} [${{ matrix.nativeImageMode }}] (GraalVM for JDK ${{ matrix.version }} @ ${{ matrix.os }})" | |
| if: needs.get-changed-infrastructure.outputs.relevant-files-changed == 'true' && needs.get-changed-infrastructure.result == 'success' && needs.get-changed-infrastructure.outputs.none-found != 'true' && github.repository == 'oracle/graalvm-reachability-metadata' | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 20 | |
| needs: get-changed-infrastructure | |
| env: | |
| GVM_TCK_NATIVE_IMAGE_MODE: ${{ matrix.nativeImageMode }} | |
| strategy: | |
| fail-fast: false | |
| matrix: ${{ fromJson(needs.get-changed-infrastructure.outputs.matrix) }} | |
| steps: | |
| - name: "☁️ Checkout repository" | |
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| - name: "🛠️ Setup latest native-build-tools snapshot" | |
| uses: ./.github/actions/setup-native-build-tools | |
| - name: "🔧 Download GraalVM for metadata testing" | |
| uses: graalvm/setup-graalvm@60c26726de13f8b90771df4bc1641a52a3159994 # v1 | |
| with: | |
| distribution: "graalvm" | |
| java-version: ${{ matrix.version }} | |
| set-java-home: "true" | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| native-image-job-reports: "true" | |
| - name: "Pull allowed docker images" | |
| run: | | |
| ./gradlew pullAllowedDockerImages -Pcoordinates=${{ matrix.coordinates }} | |
| - name: "🔎 Check metadata files content" | |
| run: | | |
| ./gradlew checkMetadataFiles -Pcoordinates=${{ matrix.coordinates }} | |
| - name: "🧪 Run '${{ matrix.coordinates }}' tests" | |
| run: | | |
| ./gradlew testInfra -Pcoordinates=${{ matrix.coordinates }} -Pparallelism=1 --stacktrace | |
| all-infrastructure-passed: | |
| name: "🧪 All build-logic triggered tests have passed" | |
| runs-on: "ubuntu-22.04" | |
| timeout-minutes: 1 | |
| needs: [get-changed-infrastructure, test-changed-infrastructure] | |
| if: always() | |
| steps: | |
| - name: "All tests passed" | |
| if: needs.test-changed-infrastructure.result == 'success' || needs.get-changed-infrastructure.outputs.relevant-files-changed == 'false' | |
| run: exit 0 | |
| - name: "Some tests failed" | |
| if: needs.test-changed-infrastructure.result == 'failure' | |
| run: exit 1 |