diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a968ff1d62787..571421a51631b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -351,10 +351,10 @@ jobs: runs-on: ubuntu-22.04 # Remove bundles so they are not misconstrued as binary distributions from the JDK project - remove-bundles: - name: 'Remove bundle artifacts' - runs-on: ubuntu-22.04 - if: always() + # remove-bundles: + # name: 'Remove bundle artifacts' + # runs-on: ubuntu-22.04 + # if: always() # needs: # - build-linux-x64 # - build-linux-x86 @@ -372,13 +372,13 @@ jobs: # - test-macos-x64 # - test-windows-x64 - steps: - # Hack to get hold of the api environment variables that are only defined for actions - - name: 'Get API configuration' - id: api - uses: actions/github-script@v7 - with: - script: 'return { url: process.env["ACTIONS_RUNTIME_URL"], token: process.env["ACTIONS_RUNTIME_TOKEN"] }' + # steps: + # # Hack to get hold of the api environment variables that are only defined for actions + # - name: 'Get API configuration' + # id: api + # uses: actions/github-script@v7 + # with: + # script: 'return { url: process.env["ACTIONS_RUNTIME_URL"], token: process.env["ACTIONS_RUNTIME_TOKEN"] }' # - name: 'Remove bundle artifacts' # run: | diff --git a/.github/workflows/test-libgraal.yml b/.github/workflows/test-libgraal.yml index df976fc6f5bea..322895f5dba57 100644 --- a/.github/workflows/test-libgraal.yml +++ b/.github/workflows/test-libgraal.yml @@ -59,15 +59,27 @@ jobs: MX_PYTHON: python3.8 steps: + - name: Get pull request URL using GitHub API + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + if: ${{ github.event_name == 'pull_request' }} + run: | + PR_URL=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ + https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }} | jq -r .html_url) + echo "PR_URL=$PR_URL" + echo "PR_URL=$PR_URL" >> ${GITHUB_ENV} + - name: 'Checkout the JDK source' uses: actions/checkout@v4 - - name: 'Clone Graal' - id: graal - uses: ./.github/actions/get-graal + # - name: 'Clone Graal' + # id: graal + # continue-on-error: true + # uses: ./.github/actions/get-graal - name: 'Get bundles' id: bundles + continue-on-error: true uses: ./.github/actions/get-bundles with: platform: ${{ inputs.platform }} @@ -75,32 +87,60 @@ jobs: include-static-libs: true - name: Determine mx and python version + continue-on-error: true run: | echo "MX_VERSION=$(jq -r '.mx_version' ${{ steps.graal.outputs.path }}/common.json)" >> ${GITHUB_ENV} echo "PYTHON_VERSION=$(grep MX_PYTHON ${{ steps.graal.outputs.path }}/ci/common.jsonnet | sed 's:.*"python\(.*\)",:\1:g')" >> ${GITHUB_ENV} - - name: Checkout graalvm/mx - uses: actions/checkout@v4 - with: - repository: graalvm/mx.git - ref: ${{ env.MX_VERSION }} - fetch-depth: 1 - path: ${{ env.MX_PATH }} - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: ${{ env.PYTHON_VERSION }} - - name: Update mx cache - uses: actions/cache@v3 - with: - path: ~/.mx - key: ${{ runner.os }}-mx-${{ hashFiles('**/suite.py') }} - restore-keys: ${{ runner.os }}-mx- + # - name: Checkout graalvm/mx + # uses: actions/checkout@v4 + # with: + # repository: graalvm/mx.git + # ref: ${{ env.MX_VERSION }} + # fetch-depth: 1 + # path: ${{ env.MX_PATH }} + # - name: Set up Python + # uses: actions/setup-python@v5 + # with: + # python-version: ${{ env.PYTHON_VERSION }} + # - name: Update mx cache + # uses: actions/cache@v4 + # with: + # path: ~/.mx + # key: ${{ runner.os }}-mx-${{ hashFiles('**/suite.py') }} + # restore-keys: ${{ runner.os }}-mx- - name: Build libgraal id: build-libgraal - run: ${MX_PATH}/mx --primary-suite-path ${{ steps.graal.outputs.path }}/vm --java-home=${{ steps.bundles.outputs.jdk-path }} --env libgraal build + continue-on-error: true + run: | + ${MX_PATH}/mx \ + --primary-suite-path ${{ steps.graal.outputs.path }}/vm \ + --java-home=${{ steps.bundles.outputs.jdk-path }} \ + --env libgraal build - name: Test libgraal id: libgraal-gate - run: ${MX_PATH}/mx --primary-suite-path ${{ steps.graal.outputs.path }}/vm --java-home=${{ steps.bundles.outputs.jdk-path }} --env libgraal gate --task 'LibGraal Compiler' + continue-on-error: true + run: | + env + ${MX_PATH}/mx \ + --primary-suite-path ${{ steps.graal.outputs.path }}/vm \ + --java-home=${{ steps.bundles.outputs.jdk-path }} \ + --env libgraal gate --task 'LibGraal Compiler' + + - name: Libgraal notify failure + id: libgraal-notify + if: job.steps.libgraal-gate.status == failure() + uses: actions/github-script@v7 + with: + script: | + const issueNumber = 8; + const { GITHUB_SERVER_URL, GITHUB_REPOSITORY, GITHUB_RUN_ID, PR_URL } = process.env; + await github.rest.issues.createComment({ + owner: 'dougxc', + repo: 'jdk', + issue_number: issueNumber, + body: `**OpenJDK libgraal CI failure**: ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}/job/${GITHUB_JOB} + Pull Request: ${PR_URL}` + });