Skip to content

Check new library versions #2

Check new library versions

Check new library versions #2

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 }}
issue: ${{ steps.set-issue.outputs.issue }}
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')
- name: "🔨 Create issue"
id: set-issue
run: |
git config --local user.email "[email protected]"
git config --local user.name "Github Actions"
issue_url=$(gh issue create --title "List unsupported library versions" --body "This issue lists unsupported versions of the existing libraries in the repo")
echo "::set-output name=issue::$issue_url"
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: |
git config --local user.email "[email protected]"
git config --local user.name "Github Actions"
gh issue comment "${{ needs.get-all-libraries.outputs.issue }}" --body "${{ matrix.coordinates }}"
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: "✏️ Edit issue for unsupported versions"
run: |
git config --local user.email "[email protected]"
git config --local user.name "Github Actions"
ALL_COMMENTS=$(gh issue view "${{ needs.get-all-libraries.outputs.issue }}" --comments)
FORMATTED_BODY=$(./gradlew -q extractLibrariesGroupsFromGithubComments --comments="$ALL_COMMENTS")
gh issue create --title "List unsupported libraries versions" --body "$FORMATTED_BODY"
gh issue close "${{ needs.get-all-libraries.outputs.issue }}"