Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
metadata/* @oracle/graalvm-reachability-maintainer
tests/* @oracle/graalvm-reachability-maintainer
tests/src/* @oracle/graalvm-reachability-maintainer
tests/tck-build-logic/* @vjovanov
tests/tck-build-logic/src/main/resources/allowed-docker-images/* @matneu
library-and-framework-list.json @fniephaus
.github/* @vjovanov
docs/* @vjovanov
docs/* @vjovanov @ban-mi
README.md @vjovanov @ban-mi
gradle/* @vjovanov
/* @vjovanov
File renamed without changes.
1 change: 1 addition & 0 deletions .github/workflows/checkstyle-skip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: "Check code style"
on:
pull_request:
paths:
- 'docs/**'
- '**.md'
- 'library-and-framework-list*.json'

Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/checkstyle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,25 @@ name: "Check code style"
on:
pull_request:
paths-ignore:
- 'docs/**'
- '**.md'
- 'library-and-framework-list*.json'

jobs:
checkstyle:
if: github.repository == 'oracle/graalvm-reachability-metadata'
name: "📋 Check style according to checkstyle.xml"
runs-on: "ubuntu-22.04"
timeout-minutes: 15
steps:
- name: "☁️ Checkout repository"
uses: actions/checkout@v4

- uses: actions/setup-python@v4
- name: "🔧 Prepare environment"
uses: graalvm/setup-graalvm@v1

- name: "🔧 Setup java"
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'graalvm'
github-token: ${{ secrets.GITHUB_TOKEN }}
java-version: '21'

- run: ./gradlew checkstyle
12 changes: 11 additions & 1 deletion .github/workflows/create-scheduled-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ permissions:
jobs:
get-changed-metadata:
name: "📋 Get a list of changed metadata"
if: github.repository == 'oracle/graalvm-reachability-metadata'
runs-on: "ubuntu-22.04"
timeout-minutes: 5
outputs:
Expand All @@ -22,16 +23,18 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: "🔧 Setup java"
uses: actions/setup-java@v4
with:
distribution: 'graalvm'
java-version: '21'

- name: "🕸️ Get changed metadata matrix"
id: set-matrix
run: |
LATEST_TAG=$(git tag --list | sort -V | tail -1)
./gradlew generateMatrixDiffCoordinates -PbaseCommit=$(git show-ref -s $LATEST_TAG) -PnewCommit=$(git rev-parse HEAD)
./gradlew generateChangedCoordinatesMatrix -PbaseCommit=$(git show-ref -s $LATEST_TAG) -PnewCommit=$(git rev-parse HEAD)

release:
needs: get-changed-metadata
Expand All @@ -45,27 +48,33 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: "🔧 Setup java"
uses: actions/setup-java@v4
with:
distribution: 'graalvm'
java-version: '21'

- name: "Get tags"
run: |
PREVIOUS_RELEASE_TAG=$(git tag --list | sort -V | tail -1)
echo "PREVIOUS_RELEASE_TAG=$PREVIOUS_RELEASE_TAG" >> ${GITHUB_ENV}

CURRENT_RELEASE_TAG=$(sed -E 's/^([0-9]+\.)([0-9]+\.)([0-9]+)/echo \1\2$((\3+1))/e' <<< $PREVIOUS_RELEASE_TAG)
echo "CURRENT_RELEASE_TAG=$CURRENT_RELEASE_TAG" >> ${GITHUB_ENV}

- name: "⬆️ Update version"
run: |
sed -i "s/project.version(\"1.0.0-SNAPSHOT\")/project.version(\"${{ env.CURRENT_RELEASE_TAG }}\")/g" build.gradle

- name: "🔍 Run spotless check"
run: |
./gradlew spotlessCheck

- name: "🏭 Generate release artifacts"
run: |
./gradlew package

- name: "📄 Commit changes"
run: |
git config --local user.email "actions@github.com"
Expand All @@ -74,6 +83,7 @@ jobs:
git commit -m "Release version ${{ env.CURRENT_RELEASE_TAG }}"
git tag ${{ env.CURRENT_RELEASE_TAG }}
git push origin ${{ env.CURRENT_RELEASE_TAG }}

- name: "📝 Publish a release"
run: |
gh release create ${{ env.CURRENT_RELEASE_TAG }} build/graalvm-reachability-metadata-*.zip --generate-notes --notes-start-tag ${{ env.PREVIOUS_RELEASE_TAG }}
4 changes: 3 additions & 1 deletion .github/workflows/library-and-framework-list-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,17 @@ on:

jobs:
validate-library-and-framework-list-json:
if: github.repository == 'oracle/graalvm-reachability-metadata'
name: "📋 Validate the JSON file"
runs-on: "ubuntu-22.04"
timeout-minutes: 5
steps:
- name: "☁️ Checkout repository"
uses: actions/checkout@v4

- uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Check that the JSON file is well-formatted and sorted by artifact
run: |
JSON="library-and-framework-list.json"
Expand All @@ -29,6 +30,7 @@ jobs:
echo "'${JSON}' is no longer sorted by artifact key. You can use 'jq' to sort it: 'sorted="$(jq -s '.[] | sort_by(.artifact)' ${JSON})" && echo -E "${sorted}" > ${JSON}"
exit 8
fi

- name: Check that the JSON file conforms to the schema
run: |
pip install check-jsonschema
Expand Down
16 changes: 10 additions & 6 deletions .github/workflows/scan-docker-images.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: "Scan docker images from the allowed docker images list"

on:
# we should run this job if somebody wants to add/update allowed docker images
# we run this job if somebody wants to add/update allowed docker images
pull_request:
paths:
- 'tests/tck-build-logic/src/main/resources/allowed-docker-images/**'
# we should run this job once a week to check if new vulnerabilities are found in existing images
# we run this job once a week to check if new vulnerabilities are found in existing images
schedule:
- cron: "0 0 * * 6"

Expand All @@ -18,18 +18,22 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: graalvm/setup-graalvm@v1

- uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'graalvm'
java-version: '21'
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: "Install required tools"
run: |
curl -sSfL https://raw.githubusercontent.com/anchore/grype/main/install.sh | sudo sh -s -- -b /usr/local/bin
curl -sSfL https://get.anchore.io/grype/v0.104.0/install.sh | sudo sh -s -- -b /usr/local/bin
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not different from the previous implementation, but running arbitrary shell commands from remote makes me kind of nervous. Maybe we should at least have a checksum to ensure the remote repo hasn't been compromised.

sudo apt-get install jq

- name: "🔎 Check changed docker images"
if: github.event_name == 'pull_request'
run: ./gradlew checkAllowedDockerImages --baseCommit=${{ github.event.pull_request.base.sha }} --newCommit=${{ github.event.pull_request.head.sha }}

- name: "🔎 Check all docker images"
if: github.event_name != 'pull_request' && github.repository == 'oracle/graalvm-reachability-metadata'
if: github.event_name == 'schedule' && github.repository == 'oracle/graalvm-reachability-metadata'
run: ./gradlew checkAllowedDockerImages
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ for VERSION in "${VERSIONS[@]}"; do
echo "$DELIMITER"


if ! run_multiple_attempts "javac compile" 1 javac; then
if ! run_multiple_attempts "javac compile" 1 compileTestJava; then
break
fi

Expand Down
17 changes: 0 additions & 17 deletions .github/workflows/test-all-metadata-skip.yml

This file was deleted.

51 changes: 27 additions & 24 deletions .github/workflows/test-all-metadata.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
name: "Test all metadata"
name: "Test all metadata (one version per test suite)"

on:
push:
branches:
- master
paths-ignore:
- '**.md'
- 'library-and-framework-list*.json'
workflow_dispatch:
pull_request:
branches:
- master
paths:
- 'ci.json'

concurrency:
group: "workflow = ${{ github.workflow }}, ref = ${{ github.event.ref }}, pr = ${{ github.event.pull_request.id }}"
cancel-in-progress: true

jobs:
get-all-metadata:
if: github.repository == 'oracle/graalvm-reachability-metadata'
if: github.event_name == 'workflow_dispatch' || github.repository == 'oracle/graalvm-reachability-metadata'
name: "📋 Get list of all supported libraries"
runs-on: "ubuntu-22.04"
timeout-minutes: 5
Expand All @@ -24,47 +23,52 @@ jobs:
steps:
- name: "☁️ Checkout repository"
uses: actions/checkout@v4
- name: "🔧 Prepare environment"
uses: graalvm/setup-graalvm@v1

- name: "🔧 Setup java"
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'graalvm'
github-token: ${{ secrets.GITHUB_TOKEN }}
java-version: '21'

- name: "🕸️ Populate matrix"
id: set-matrix
run: |
./gradlew generateMatrixMatchingCoordinates -Pcoordinates=all
./gradlew generateMatrixBatchedCoordinates -Pbatches=16

test-all-metadata:
if: github.repository == 'oracle/graalvm-reachability-metadata'
name: "🧪 ${{ matrix.coordinates }} (GraalVM for JDK ${{ matrix.version }} @ ${{ matrix.os }})"
runs-on: ${{ matrix.os }}
timeout-minutes: 20
timeout-minutes: 120
needs: get-all-metadata
strategy:
fail-fast: false
matrix: ${{fromJson(needs.get-all-metadata.outputs.matrix)}}
steps:
- name: "☁️ Checkout repository"
uses: actions/checkout@v4

- name: "🔧 Setup java"
uses: actions/setup-java@v4
with:
distribution: 'oracle'
java-version: '17'
- name: "🔧 Prepare environment"
distribution: 'graalvm'
java-version: '21'

- name: "🔧 Download GraalVM for metadata testing"
uses: graalvm/setup-graalvm@v1
with:
set-java-home: 'false'
java-version: ${{ matrix.version }}
distribution: 'graalvm'
github-token: ${{ secrets.GITHUB_TOKEN }}
java-version: ${{ matrix.version }}
set-java-home: 'false'
native-image-job-reports: 'true'
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: "Pull allowed docker images"
run: |
./gradlew pullAllowedDockerImages --coordinates=${{ matrix.coordinates }}
./gradlew pullAllowedDockerImages -Pcoordinates=${{ matrix.coordinates }}

- name: "Disable docker networking"
run: bash ./.github/workflows/disable-docker.sh
run: bash ./.github/workflows/scripts/disable-docker.sh

- name: "🧪 Run '${{ matrix.coordinates }}' tests"
run: |
./gradlew test -Pcoordinates=${{ matrix.coordinates }}
Expand All @@ -73,7 +77,6 @@ jobs:
name: "🧪 All metadata tests have passed"
runs-on: "ubuntu-22.04"
timeout-minutes: 1
if: ${{ always() }} && github.repository == 'oracle/graalvm-reachability-metadata'
needs: test-all-metadata
steps:
- name: "All tests passed"
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/test-changed-infrastructure-skip.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: "Test changed build logic"

on:
pull_request:
branches:
- master
paths-ignore:
- "tests/tck-build-logic/**"
- "gradle/**"
- "build.gradle"
- "settings.gradle"
- "gradle.properties"

jobs:
get-changed-infrastructure:
name: "📋 Get a list of libraries to test for build-logic changes"
runs-on: ubuntu-latest
steps:
- run: 'echo "No build required"'

all-infrastructure-passed:
name: "🧪 All build-logic triggered tests have passed"
runs-on: ubuntu-latest
steps:
- run: 'echo "No build required"'
Loading
Loading