dongjoon-hyun commented on a change in pull request #33410:
URL: https://github.com/apache/spark/pull/33410#discussion_r671995134



##########
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:
       Could you expose `branch` here? The existing 
`build_and_test_scala2.13_daily.yml` exposes the branch name. Without branch 
changes, it was confusing at that time. For this job, I'm wondering how it is 
distinguished.




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to