From 3a2b282b5be88dfe42118195a64508cf267389d6 Mon Sep 17 00:00:00 2001 From: Matthias Pohl Date: Sun, 10 Dec 2023 13:52:57 +0100 Subject: [PATCH] [FLINK-27075][ci] Adds configuration for nightly workflow runs --- ...k-nightly-most-recent-released-version.yml | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 .github/workflows/flink-nightly-most-recent-released-version.yml diff --git a/.github/workflows/flink-nightly-most-recent-released-version.yml b/.github/workflows/flink-nightly-most-recent-released-version.yml new file mode 100644 index 00000000000000..d932b05da191f9 --- /dev/null +++ b/.github/workflows/flink-nightly-most-recent-released-version.yml @@ -0,0 +1,62 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# The nightly run workflow runs on the most-recently created release branch +# A separate workflow configuration was necessary (in contrast to using GitHub's +# matrix strategy) because three layers of composite workflows are not well visualized +# in GitHub Action. + +name: "Nightly (most-recent release)" + +on: + schedule: + - cron: '0 17 * * *' + workflow_dispatch: + +permissions: read-all + +jobs: + determine-branch: + name: "Select most-recent release branch" + runs-on: "ubuntu-latest" + outputs: + branch: ${{ steps.branch-selection.outputs.branch }} + steps: + - name: "Flink Checkout" + uses: actions/checkout@v3 + with: + persist-credentials: false + - name: "Select most-recent release branch" + id: branch-selection + run: | + # actions/checkout only fetches one branch but we need all the branch information from origin + git fetch --no-tags --depth=1 origin + + # filters the release branches and sorts by version + selected_branch="$(git branch --remotes | grep -o "release-[0-9]\{1,\}\.[0-9]\{1,\}" | sort -u -t'.' -k2,2V | tail -1)" + echo "Most-recently created release branch: ${selected_branch}" + echo "branch=${selected_branch}" >> "$GITHUB_OUTPUT" + + nightly: + name: "Nightly ${{ needs.determine-branch.outputs.branch }}" + needs: determine-branch + uses: ./.github/workflows/flink-ci-extended.yml + with: + branch: ${{ needs.determine-branch.outputs.branch }} + supported-jdk-versions: "11 17" + secrets: + s3_bucket: ${{ secrets.IT_CASE_S3_BUCKET }} + s3_access_key: ${{ secrets.IT_CASE_S3_ACCESS_KEY }} + s3_secret_key: ${{ secrets.IT_CASE_S3_SECRET_KEY }}