Skip to content

Fix copyright headers stage 2 #110

Fix copyright headers stage 2

Fix copyright headers stage 2 #110

name: "Test changed build logic"
on:
pull_request:
branches:
- master
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@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@v4
with:
distribution: 'graalvm'
java-version: '21'
- 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 }} (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
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.get-changed-infrastructure.outputs.matrix) }}
steps:
- name: "☁️ Checkout repository"
uses: actions/checkout@v4
- name: "🔧 Setup java"
uses: actions/setup-java@v4
with:
distribution: 'graalvm'
java-version: '21'
- name: "🔧 Download GraalVM for metadata testing"
uses: graalvm/setup-graalvm@v1
with:
distribution: "graalvm"
java-version: ${{ matrix.version }}
set-java-home: "false"
github-token: ${{ secrets.GITHUB_TOKEN }}
native-image-job-reports: "true"
- name: "Pull allowed docker images"
run: |
./gradlew pullAllowedDockerImages -Pcoordinates=${{ matrix.coordinates }}
- name: "Disable docker networking"
run: bash ./.github/workflows/scripts/disable-docker.sh
- name: "🔎 Check metadata files content"
run: |
./gradlew checkMetadataFiles -Pcoordinates=${{ matrix.coordinates }}
- name: "🧪 Run '${{ matrix.coordinates }}' tests"
run: |
./gradlew test -Pcoordinates=${{ matrix.coordinates }}
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