chihsuan commented on code in PR #11839: URL: https://github.com/apache/ozone/pull/11839#discussion_r4456465166
########## .github/workflows/schedule-main-build.yml: ########## @@ -0,0 +1,86 @@ +# 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. + +# This workflow runs CI on the default branch periodically. + +name: build-default-branch + +on: + schedule: + - cron: '33 */4 * * *' + workflow_dispatch: + # manual trigger: for testing in forks, and safety net in apache + +concurrency: + # only one build at a time + group: scheduled-build + cancel-in-progress: false + +permissions: + contents: read + +env: + MARKER_FILE: scheduled-build + STASH_KEY: scheduled-build-${{ github.sha }} + +run-name: CI for ${{ github.sha }} on ${{ github.event_name }} + +jobs: + pre-check: + runs-on: ubuntu-slim + if: github.repository_owner == 'apache' || github.event_name == 'workflow_dispatch' + outputs: + hit: ${{ steps.stash.outputs.stash-hit || 'false' }} + steps: + - name: Check for previous successful build of ${{ github.sha }} + id: stash + uses: apache/infrastructure-actions/stash/restore@restore/v1 + with: + clean: true + path: ${{ env.MARKER_FILE }} + key: ${{ env.STASH_KEY }} + continue-on-error: true + - name: Debug + id: debug + run: | + echo "Found successful build of $GITHUB_SHA: $found" + env: + found: ${{ steps.stash.outputs.stash-hit == 'true' }} + + CI: + needs: pre-check + # no scheduled run in forks + if: needs.pre-check.outputs.hit != 'true' + uses: $/.github/workflows/ci.yml Review Comment: None of the [checkout steps](https://github.com/apache/ozone/blob/1dfa64d33a9b423fba2fc75266329dd08d1232b2/.github/workflows/ci.yml#L76-L93) in `ci.yml` match `schedule`, so I think `Selective checks` would fail without the source. 🤔 Should the push checkout also cover `schedule`? [Coverage](https://github.com/apache/ozone/blob/1dfa64d33a9b423fba2fc75266329dd08d1232b2/.github/workflows/ci.yml#L477-L480) and the [config doc update](https://github.com/apache/ozone/blob/1dfa64d33a9b423fba2fc75266329dd08d1232b2/.github/workflows/ci.yml#L151-L174) also only run on `push`. ########## .github/workflows/post-commit.yml: ########## @@ -17,6 +17,9 @@ on: pull_request: types: [opened, ready_for_review, synchronize] push: + branches-ignore: + - master + - 'dependabot**' Review Comment: nit: Probably for #11871, but this filter may need to go once `pull_request` is dropped there. ########## .github/workflows/post-commit.yml: ########## @@ -47,9 +50,7 @@ permissions: contents: read jobs: CI: - if: github.event_name == 'pull_request' - || (github.repository == 'apache/ozone' && !startsWith(github.ref_name, 'dependabot')) - || (github.repository != 'apache/ozone' && github.ref_name != 'master') + if: github.repository_owner != 'apache' || github.event_name != 'push' Review Comment: With this condition, pushes to release and feature branches in Apache would also skip CI once they pick up this file, not just `master`. Is that intended, or should it only skip `master`? -- 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]
