HyukjinKwon commented on a change in pull request #33410:
URL: https://github.com/apache/spark/pull/33410#discussion_r671996885



##########
File path: .github/workflows/build_and_test.yml
##########
@@ -5,11 +5,46 @@ on:
     branches:
     - '**'
     - '!branch-*.*'
+  schedule:
+    # master
+    - cron: '0 0 * * *'
+    # branch-3.2
+    - cron: '0 1 * * *'
 
 jobs:
+  configure-jobs:
+    name: Configure jobs
+    runs-on: ubuntu-20.04
+    outputs:
+      should_run: ${{ steps.set-outputs.outputs.should_run }}
+      branch: ${{ steps.set-outputs.outputs.branch }}
+      envs: ${{ steps.set-outputs.outputs.envs }}
+    env:
+      SCHEDULE: ${{ github.event.schedule }}
+    steps:
+    - name: Configure branch and additional environment variables
+      id: set-outputs
+      run: |
+        if [ "$SCHEDULE" = "0 0 * * *" ]; then
+          echo '::set-output name=branch::master'
+          echo '::set-output name=envs::{"SCALA_PROFILE": "scala2.13"}'
+          echo '::set-output name=should_run::${{ github.repository == 
'apache/spark' }}'
+        elif [ "$SCHEDULE" = "0 1 * * *" ]; then
+          echo '::set-output name=branch::branch-3.2"
+          echo '::set-output name=envs::{"SCALA_PROFILE": "scala2.13"}'
+          echo '::set-output name=should_run::${{ github.repository == 
'apache/spark' }}'
+        else
+          echo '::set-output name=branch::master' # Default branch to run on. 
CHANGE here when a branch is cut out.
+          echo '::set-output name=envs::{}'
+          echo '::set-output name=should_run::true'
+        fi
+
   # Build: build Spark and run the tests for specified modules.
   build:
     name: "Build modules: ${{ matrix.modules }} ${{ matrix.comment }} (JDK ${{ 
matrix.java }}, ${{ matrix.hadoop }}, ${{ matrix.hive }})"

Review comment:
       Oh, actually I added `caption` for that purpose. It will be shown in the 
job name like:
   
   <img width="749" alt="Screen Shot 2021-07-19 at 2 30 01 PM" 
src="https://user-images.githubusercontent.com/6477701/126107646-040c9252-3371-4ff2-94ea-95f59dac34b0.png";>
   
   (ref: 
https://github.community/t/github-actions-dynamic-name-of-the-workflow-with-workflow-dispatch/150327)
   
   




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to