Skip to content

Check new library versions #3

Check new library versions

Check new library versions #3

name: "Check new library versions"
# The workflow runs bi-weekly alternating with the scheduled release workflow. This way we have enough time to provide metadata for failing tests.
# In case we need more scans, there is a possibility to trigger the workflow manually.
on:
schedule:
- cron: "0 0 8 * *"
- cron: "0 0 22 * *"
workflow_dispatch:
permissions:
contents: write
actions: write
concurrency:
group: "workflow = ${{ github.workflow }}, ref = ${{ github.event.ref }}, pr = ${{ github.event.pull_request.id }}"
cancel-in-progress: true
jobs:
get-all-libraries:
if: github.repository == 'oracle/graalvm-reachability-metadata'
name: "📋 Get list of all supported libraries with newer versions"
permissions: write-all
runs-on: "ubuntu-20.04"
timeout-minutes: 5
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: "☁️ Checkout repository"
uses: actions/checkout@v4
- name: "🔧 Prepare environment"
uses: graalvm/setup-graalvm@v1
with:
java-version: '21'
distribution: 'graalvm'
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: "🕸️ Populate matrix"
id: set-matrix
run: |
./gradlew fetchExistingLibrariesWithNewerVersions --matrixLimit=200
- name: "🔨 Create branch"
run: |
git config --local user.email "[email protected]"
git config --local user.name "Github Actions"
git switch -C check-new-library-versions/$(date '+%Y-%m-%d')
git push origin check-new-library-versions/$(date '+%Y-%m-%d')
test-all-metadata:
name: "🧪 ${{ matrix.coordinates }} (GraalVM for JDK ${{ matrix.version }} @ ${{ matrix.os }})"
permissions: write-all
runs-on: ${{ matrix.os }}
timeout-minutes: 20
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
needs: get-all-libraries
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.get-all-libraries.outputs.matrix) }}
steps:
- name: "☁️ Checkout repository"
uses: actions/checkout@v4
- name: "🔧 Setup java"
uses: actions/setup-java@v4
with:
distribution: 'oracle'
java-version: '21'
- name: "🔧 Prepare environment"
uses: graalvm/setup-graalvm@v1
with:
set-java-home: 'false'
java-version: ${{ matrix.version }}
distribution: 'graalvm'
github-token: ${{ secrets.GITHUB_TOKEN }}
native-image-job-reports: 'true'
- name: "Extract test path and library version"
run: |
LIBRARY_PATH=$(echo ${{ matrix.coordinates }} | cut -d ':' -f1-2 | sed 's/:/\//g')
LATEST_VERSION=$(find tests/src/$LIBRARY_PATH/* -maxdepth 1 -type d | sort -V | tail -1 | cut -d '/' -f5)
TEST_PATH="$LIBRARY_PATH/$LATEST_VERSION"
TEST_COORDINATES=$(echo "$TEST_PATH" | tr / :)
echo "LATEST_VERSION=$LATEST_VERSION" >> ${GITHUB_ENV}
echo "TEST_PATH=$TEST_PATH" >> ${GITHUB_ENV}
echo "TEST_COORDINATES=$TEST_COORDINATES" >> ${GITHUB_ENV}
- name: "Pull allowed docker images"
run: |
./gradlew pullAllowedDockerImages --coordinates=${{ env.TEST_COORDINATES }}
- name: "Disable docker"
run: |
sudo apt-get install openbsd-inetd
sudo bash -c "cat ./.github/workflows/discard-port.conf >> /etc/inetd.conf"
sudo systemctl start inetd
sudo mkdir /etc/systemd/system/docker.service.d
sudo bash -c "cat ./.github/workflows/dockerd.service > /etc/systemd/system/docker.service.d/http-proxy.conf"
sudo systemctl daemon-reload
sudo systemctl restart docker
- name: "🧪 Run '${{ env.TEST_COORDINATES }}' tests"
run: |
TESTING_VERSION=$(echo ${{ matrix.coordinates }} | cut -d ":" -f3)
export GVM_TCK_LV=$TESTING_VERSION
./gradlew test -Pcoordinates=${{ env.TEST_COORDINATES }}
- name: "✔️ New library is supported"
if: success()
run: |
bash ./.github/workflows/tryPushVersionsUpdate.sh ${{ matrix.coordinates }} ${{ env.LATEST_VERSION }}
- name: "❗ New library is not supported"
if: failure()
run: |
LIB=$(echo "${{ matrix.coordinates }}" | sed 's/:/_/g')
touch $LIB
echo "UNSUPPORTED_LIB=$LIB" >> $GITHUB_ENV
- name: "Upload artifacts"
if: failure()
id: upload
continue-on-error: true
uses: actions/upload-artifact@v4
with:
name: ${{ env.UNSUPPORTED_LIB }}
path: ${{ env.UNSUPPORTED_LIB }}
retention-days: 1
process-results:
name: "🧪 Process results"
runs-on: "ubuntu-20.04"
if: ${{ always() }}
needs:
- get-all-libraries
- test-all-metadata
permissions: write-all
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: "☁️ Checkout repository"
uses: actions/checkout@v4
- name: "🔧 Setup java"
uses: actions/setup-java@v4
with:
distribution: 'oracle'
java-version: '21'
- name: "✏️ PR for supported versions"
run: |
git config --local user.email "[email protected]"
git config --local user.name "Github Actions"
git fetch origin check-new-library-versions/$(date '+%Y-%m-%d')
git checkout check-new-library-versions/$(date '+%Y-%m-%d')
gh pr create --title "Update supported library versions" --body "This pull request updates supported versions of the existing libraries in the repo"
- name: "Download artifacts for unsupported versions"
uses: actions/download-artifact@v4
with:
path: ./unsupported
- name: "✏️ Issue for unsupported versions"
run: |
git config --local user.email "[email protected]"
git config --local user.name "Github Actions"
LABEL="library-update"
ALL_LIBRARIES=$(ls unsupported)
FORMATTED_BODY=$(./gradlew -q groupLibrariesByName --libraries="$ALL_LIBRARIES")
EXISTING_ISSUE=$(gh issue list --label "$LABEL" --state open --limit 1 --json url | jq -r '.[0].url')
if [ $EXISTING_ISSUE != "null" ]; then
gh issue edit $EXISTING_ISSUE --body "$FORMATTED_BODY"
else
gh issue create --title "List unsupported libraries versions" --body "$FORMATTED_BODY" --label $LABEL
fi