From 81de57cee1d8e462b941923e2b9ec8125e96a09b Mon Sep 17 00:00:00 2001 From: Fabio Niephaus Date: Wed, 26 Oct 2022 10:40:24 +0200 Subject: [PATCH 1/4] Rename `GATE` to `GATE_TAGS`. --- .github/workflows/main.yml | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 03e18a4f384..68dc25823fb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -48,7 +48,7 @@ permissions: jobs: build-graalvm: - name: ${{ matrix.env.PRIMARY }} ${{ matrix.env.GATE }} JDK${{ matrix.env.JDK_VERSION }} ${{ matrix.env.WITHOUT_VCS }} + name: ${{ matrix.env.PRIMARY }} ${{ matrix.env.GATE_TAGS }} JDK${{ matrix.env.JDK_VERSION }} ${{ matrix.env.WITHOUT_VCS }} runs-on: ubuntu-20.04 strategy: fail-fast: false @@ -57,54 +57,54 @@ jobs: # /compiler - env: JDK_VERSION: "19" - GATE: "style,fullbuild,test" + GATE_TAGS: "style,fullbuild,test" PRIMARY: "compiler" - env: JDK_VERSION: "19" - GATE: "build,bootstraplite" + GATE_TAGS: "build,bootstraplite" PRIMARY: "compiler" # /espresso - env: JDK_VERSION: "17" # espresso does not support JDK19 yet - GATE: "style,fullbuild" + GATE_TAGS: "style,fullbuild" PRIMARY: "espresso" # /substratevm - env: JDK_VERSION: "19" - GATE: "style,fullbuild" + GATE_TAGS: "style,fullbuild" PRIMARY: "substratevm" - env: JDK_VERSION: "19" - GATE: "build,test,helloworld" + GATE_TAGS: "build,test,helloworld" PRIMARY: "substratevm" - env: JDK_VERSION: "19" - GATE: "build,helloworld_debug" + GATE_TAGS: "build,helloworld_debug" PRIMARY: "substratevm" - env: JDK_VERSION: "19" - GATE: "build,debuginfotest" + GATE_TAGS: "build,debuginfotest" PRIMARY: "substratevm" - env: JDK_VERSION: "19" - GATE: "hellomodule" + GATE_TAGS: "hellomodule" PRIMARY: "substratevm" # /sulong - env: JDK_VERSION: "19" - GATE: "style,fullbuild,sulongBasic" + GATE_TAGS: "style,fullbuild,sulongBasic" PRIMARY: "sulong" # /vm - env: JDK_VERSION: "19" - GATE: "build,sulong" + GATE_TAGS: "build,sulong" PRIMARY: "vm" DYNAMIC_IMPORTS: "/sulong,/substratevm" DISABLE_POLYGLOT: true DISABLE_LIBPOLYGLOT: true - env: JDK_VERSION: "17" - GATE: "build" + GATE_TAGS: "build" PRIMARY: "vm" DYNAMIC_IMPORTS: "/tools,/substratevm,/sulong" NATIVE_IMAGES: "polyglot" @@ -114,7 +114,7 @@ jobs: uses: actions/checkout@v3 with: ref: ${{ github.ref }} # Lock ref to current branch to avoid fetching others - fetch-depth: "${{ contains(matrix.env.GATE, 'style') && '0' || '1' }}" # The style gate needs the full commit history for checking copyright years + fetch-depth: "${{ contains(matrix.env.GATE_TAGS, 'style') && '0' || '1' }}" # The style gate needs the full commit history for checking copyright years - name: Determine mx version run: echo "MX_VERSION=$(jq -r '.mx_version' common.json)" >> ${GITHUB_ENV} - name: Checkout graalvm/mx @@ -140,20 +140,20 @@ jobs: mkdir jdk-dl ${MX_PATH}/mx --java-home= fetch-jdk --jdk-id labsjdk-ce-${JDK_VERSION} --to jdk-dl --alias ${JAVA_HOME} - name: Update dependency cache - if: ${{ contains(matrix.env.GATE, 'debug') || contains(matrix.env.GATE, 'style') }} + if: ${{ contains(matrix.env.GATE_TAGS, 'debug') || contains(matrix.env.GATE_TAGS, 'style') }} run: sudo apt update - name: Install debug dependencies - if: ${{ contains(matrix.env.GATE, 'debug') }} + if: ${{ contains(matrix.env.GATE_TAGS, 'debug') }} run: sudo apt install gdb - name: Install style dependencies - if: ${{ contains(matrix.env.GATE, 'style') }} + if: ${{ contains(matrix.env.GATE_TAGS, 'style') }} run: | sudo apt install python3-pip python-setuptools jq -r '.deps.common.packages | to_entries[] | select(.key | startswith("pip:")) | (.key | split(":")[1]) + .value' common.json | xargs sudo pip install ${MX_PYTHON} -m pip install jsonschema==4.6.1 - name: Download Eclipse - if: ${{ contains(matrix.env.GATE, 'style') }} + if: ${{ contains(matrix.env.GATE_TAGS, 'style') }} run: | ECLIPSE_TAR=eclipse.tar.gz ECLIPSE_ORG_VERSION=$(jq -r '.downloads.eclipse.eclipse_org.version' common.json) @@ -166,4 +166,4 @@ jobs: run: rm -rf .git - name: Build GraalVM and run gate env: ${{ matrix.env }} - run: ${MX_PATH}/mx --primary-suite-path ${PRIMARY} --java-home=${JAVA_HOME} gate --strict-mode --tags ${GATE} + run: ${MX_PATH}/mx --primary-suite-path ${PRIMARY} --java-home=${JAVA_HOME} gate --strict-mode --tags ${GATE_TAGS} From fb14aa4619b7589259a7552d15d2fe0bdf84643a Mon Sep 17 00:00:00 2001 From: Fabio Niephaus Date: Wed, 26 Oct 2022 10:42:19 +0200 Subject: [PATCH 2/4] Introduce helper env vars. --- .github/workflows/main.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 68dc25823fb..521f9e7411f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -109,12 +109,15 @@ jobs: DYNAMIC_IMPORTS: "/tools,/substratevm,/sulong" NATIVE_IMAGES: "polyglot" WITHOUT_VCS: true + env: + MX_RUNS_DEBUG: ${{ contains(matrix.env.GATE_TAGS, 'debug') }} + MX_RUNS_STYLE: ${{ contains(matrix.env.GATE_TAGS, 'style') }} steps: - name: Checkout oracle/graal uses: actions/checkout@v3 with: ref: ${{ github.ref }} # Lock ref to current branch to avoid fetching others - fetch-depth: "${{ contains(matrix.env.GATE_TAGS, 'style') && '0' || '1' }}" # The style gate needs the full commit history for checking copyright years + fetch-depth: "${{ env.MX_RUNS_STYLE && '0' || '1' }}" # The style gate needs the full commit history for checking copyright years - name: Determine mx version run: echo "MX_VERSION=$(jq -r '.mx_version' common.json)" >> ${GITHUB_ENV} - name: Checkout graalvm/mx @@ -140,20 +143,20 @@ jobs: mkdir jdk-dl ${MX_PATH}/mx --java-home= fetch-jdk --jdk-id labsjdk-ce-${JDK_VERSION} --to jdk-dl --alias ${JAVA_HOME} - name: Update dependency cache - if: ${{ contains(matrix.env.GATE_TAGS, 'debug') || contains(matrix.env.GATE_TAGS, 'style') }} + if: ${{ env.MX_RUNS_DEBUG == 'true' || env.MX_RUNS_STYLE == 'true' }} run: sudo apt update - name: Install debug dependencies - if: ${{ contains(matrix.env.GATE_TAGS, 'debug') }} + if: ${{ env.MX_RUNS_DEBUG == 'true' }} run: sudo apt install gdb - name: Install style dependencies - if: ${{ contains(matrix.env.GATE_TAGS, 'style') }} + if: ${{ env.MX_RUNS_STYLE == 'true' }} run: | sudo apt install python3-pip python-setuptools jq -r '.deps.common.packages | to_entries[] | select(.key | startswith("pip:")) | (.key | split(":")[1]) + .value' common.json | xargs sudo pip install ${MX_PYTHON} -m pip install jsonschema==4.6.1 - name: Download Eclipse - if: ${{ contains(matrix.env.GATE_TAGS, 'style') }} + if: ${{ env.MX_RUNS_STYLE == 'true' }} run: | ECLIPSE_TAR=eclipse.tar.gz ECLIPSE_ORG_VERSION=$(jq -r '.downloads.eclipse.eclipse_org.version' common.json) From 00f556787a07cc2c9bb45932074ed86095d9f9b9 Mon Sep 17 00:00:00 2001 From: Fabio Niephaus Date: Wed, 26 Oct 2022 10:54:38 +0200 Subject: [PATCH 3/4] Add Truffle build job. Also, add support for running gate without tags. --- .github/workflows/main.yml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 521f9e7411f..e1ef2f93499 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -94,6 +94,11 @@ jobs: JDK_VERSION: "19" GATE_TAGS: "style,fullbuild,sulongBasic" PRIMARY: "sulong" + # /truffle + - env: + JDK_VERSION: "19" + GATE_TAGS: "" # Truffle does not use tags + PRIMARY: "truffle" # /vm - env: JDK_VERSION: "19" @@ -110,8 +115,8 @@ jobs: NATIVE_IMAGES: "polyglot" WITHOUT_VCS: true env: - MX_RUNS_DEBUG: ${{ contains(matrix.env.GATE_TAGS, 'debug') }} - MX_RUNS_STYLE: ${{ contains(matrix.env.GATE_TAGS, 'style') }} + MX_RUNS_DEBUG: ${{ contains(matrix.env.GATE_TAGS, 'debug') || matrix.env.GATE_TAGS == '' }} + MX_RUNS_STYLE: ${{ contains(matrix.env.GATE_TAGS, 'style') || matrix.env.GATE_TAGS == '' }} steps: - name: Checkout oracle/graal uses: actions/checkout@v3 @@ -167,6 +172,11 @@ jobs: - name: Remove .git directory if: ${{ matrix.env.WITHOUT_VCS }} run: rm -rf .git - - name: Build GraalVM and run gate + - name: Build GraalVM and run gate with tags env: ${{ matrix.env }} run: ${MX_PATH}/mx --primary-suite-path ${PRIMARY} --java-home=${JAVA_HOME} gate --strict-mode --tags ${GATE_TAGS} + if: ${{ matrix.env.GATE_TAGS != '' }} + - name: Build GraalVM and run gate without tags + env: ${{ matrix.env }} + run: ${MX_PATH}/mx --primary-suite-path ${PRIMARY} --java-home=${JAVA_HOME} gate --strict-mode + if: ${{ matrix.env.GATE_TAGS == '' }} From f7ba00b47e73490021c2da05f95a75b7c8f822bf Mon Sep 17 00:00:00 2001 From: Fabio Niephaus Date: Wed, 26 Oct 2022 11:51:18 +0200 Subject: [PATCH 4/4] Tweak job names. --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e1ef2f93499..8d55dc7171b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -48,7 +48,7 @@ permissions: jobs: build-graalvm: - name: ${{ matrix.env.PRIMARY }} ${{ matrix.env.GATE_TAGS }} JDK${{ matrix.env.JDK_VERSION }} ${{ matrix.env.WITHOUT_VCS }} + name: /${{ matrix.env.PRIMARY }} ${{ matrix.env.GATE_TAGS }} JDK${{ matrix.env.JDK_VERSION }} runs-on: ubuntu-20.04 strategy: fail-fast: false