Преглед изворни кода

Ability to execute the GraalVM native tests with test native Github label (#10644)

Jean Bisutti пре 1 година
родитељ
комит
8c080313c9

+ 5 - 0
.github/workflows/build-pull-request.yml

@@ -26,6 +26,11 @@ jobs:
     with:
       cache-read-only: true
 
+  test-native:
+    uses: ./.github/workflows/reusable-native-tests.yml
+    with:
+      skip-native-tests: ${{ !contains(github.event.pull_request.labels.*.name, 'test native') }}
+
   muzzle:
     uses: ./.github/workflows/reusable-muzzle.yml
     with:

+ 4 - 19
.github/workflows/native-tests-daily.yml

@@ -1,4 +1,4 @@
-name: GraalVM native tests
+name: Daily GraalVM native tests
 
 on:
   schedule:
@@ -7,27 +7,12 @@ on:
   workflow_dispatch:
 
 jobs:
-  build:
-    runs-on: ubuntu-latest
-    steps:
-      - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
-      - uses: graalvm/setup-graalvm@5c3001733f88c5e6475916e448f865429d2c154e # v1.1.8.1
-        with:
-          version: "latest"
-          java-version: "17"
-          components: "native-image"
-      - name: Running test
-        run: |
-          echo "GRAALVM_HOME: $GRAALVM_HOME"
-          echo "JAVA_HOME: $JAVA_HOME"
-          java --version
-          gu --version
-          native-image --version
-          ./gradlew nativeTest
+  graalvm-native-tests:
+    uses: ./.github/workflows/reusable-native-tests
 
   workflow-notification:
     needs:
-      - build
+      - graalvm-native-tests
     if: always()
     uses: ./.github/workflows/reusable-workflow-notification.yml
     with:

+ 28 - 0
.github/workflows/reusable-native-tests.yml

@@ -0,0 +1,28 @@
+name: Reusable - Native tests
+
+on:
+  workflow_call:
+    inputs:
+      skip-native-tests:
+        type: boolean
+        required: false
+
+jobs:
+  graalvm-native-tests:
+    if: "!inputs.skip-native-tests"
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
+      - uses: graalvm/setup-graalvm@d72e3dbf5f44eb0b78c4f8ec61a262d8bf9b94af # v1.1.7.1
+        with:
+          version: "latest"
+          java-version: "17"
+          components: "native-image"
+      - name: Running test
+        run: |
+          echo "GRAALVM_HOME: $GRAALVM_HOME"
+          echo "JAVA_HOME: $JAVA_HOME"
+          java --version
+          gu --version
+          native-image --version
+          ./gradlew nativeTest