mirror of
https://github.com/bevyengine/bevy
synced 2024-12-24 03:53:06 +00:00
Skip all jobs on the Weekly beta compile test
workflow when running on a fork (#16674)
# Objective The weekly beta compile test workflow can be useful to people who have forked the repository. However, there are a few small issues with how this workflow is currently set up: * Scheduled workflows run on the base/default branch, with no way (currently) to change this. On forks, the base/default branch is usually kept in sync with the main Bevy repository, meaning that running this workflow on forks would just be a waste of resources. (See [here](https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#schedule) - "Scheduled workflows will only run on the default branch.") * Even if there was a way to change the branch that a scheduled workflow runs on, forks default to not having an issue tracker. * Even in the event that a fork's issue tracker is enabled, most users probably don't want to receive automated issues in the event of a compilation failure. Because of these reasons, this workflow is irrelevant for 99% of forks. ## Solution We now skip all jobs on the `Weekly beta compile test` workflow, if we detect we're running this workflow on a fork. ## Testing Testing? Who needs testing? (Seriously though, I made sure the syntax is correct.)
This commit is contained in:
parent
72f096c91e
commit
24c3bd5f00
1 changed files with 23 additions and 1 deletions
24
.github/workflows/weekly.yml
vendored
24
.github/workflows/weekly.yml
vendored
|
@ -10,12 +10,29 @@ on:
|
||||||
env:
|
env:
|
||||||
CARGO_TERM_COLOR: always
|
CARGO_TERM_COLOR: always
|
||||||
|
|
||||||
|
# The jobs listed here are intentionally skipped when running on forks, for a number of reasons:
|
||||||
|
#
|
||||||
|
# * Scheduled workflows run on the base/default branch, with no way (currently) to change this. On
|
||||||
|
# forks, the base/default branch is usually kept in sync with the main Bevy repository, meaning
|
||||||
|
# that running this workflow on forks would just be a waste of resources.
|
||||||
|
#
|
||||||
|
# * Even if there was a way to change the branch that a scheduled workflow runs on, forks default
|
||||||
|
# to not having an issue tracker.
|
||||||
|
#
|
||||||
|
# * Even in the event that a fork's issue tracker is enabled, most users probably don't want to
|
||||||
|
# receive automated issues in the event of a compilation failure.
|
||||||
|
#
|
||||||
|
# Because of these reasons, this workflow is irrelevant for 99% of forks. Thus, the jobs here will
|
||||||
|
# be skipped when running on any repository that isn't the main Bevy repository.
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [windows-latest, ubuntu-latest, macos-latest]
|
os: [windows-latest, ubuntu-latest, macos-latest]
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
# Disable this job when running on a fork.
|
||||||
|
if: github.repository == 'bevyengine/bevy'
|
||||||
timeout-minutes: 30
|
timeout-minutes: 30
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
@ -31,6 +48,8 @@ jobs:
|
||||||
|
|
||||||
lint:
|
lint:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
# Disable this job when running on a fork.
|
||||||
|
if: github.repository == 'bevyengine/bevy'
|
||||||
timeout-minutes: 30
|
timeout-minutes: 30
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
@ -48,6 +67,8 @@ jobs:
|
||||||
|
|
||||||
check-compiles:
|
check-compiles:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
# Disable this job when running on a fork.
|
||||||
|
if: github.repository == 'bevyengine/bevy'
|
||||||
timeout-minutes: 30
|
timeout-minutes: 30
|
||||||
needs: test
|
needs: test
|
||||||
steps:
|
steps:
|
||||||
|
@ -65,8 +86,9 @@ jobs:
|
||||||
needs: [test, lint, check-compiles]
|
needs: [test, lint, check-compiles]
|
||||||
permissions:
|
permissions:
|
||||||
issues: write
|
issues: write
|
||||||
|
# We disable this job on forks, because
|
||||||
# Use always() so the job doesn't get canceled if any other jobs fail
|
# Use always() so the job doesn't get canceled if any other jobs fail
|
||||||
if: ${{ always() && contains(needs.*.result, 'failure') }}
|
if: ${{ github.repository == 'bevyengine/bevy' && always() && contains(needs.*.result, 'failure') }}
|
||||||
steps:
|
steps:
|
||||||
- name: Create issue
|
- name: Create issue
|
||||||
run: |
|
run: |
|
||||||
|
|
Loading…
Reference in a new issue