mirror of
https://github.com/bevyengine/bevy
synced 2024-12-24 20:13:07 +00:00
24c3bd5f00
# 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.)
115 lines
4.2 KiB
YAML
115 lines
4.2 KiB
YAML
name: Weekly beta compile test
|
|
|
|
on:
|
|
schedule:
|
|
# New versions of rust release on Thursdays. We test on Mondays to get at least 3 days of warning before all our CI breaks again.
|
|
# https://forge.rust-lang.org/release/process.html#release-day-thursday
|
|
- cron: '0 12 * * 1'
|
|
workflow_dispatch:
|
|
|
|
env:
|
|
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:
|
|
test:
|
|
strategy:
|
|
matrix:
|
|
os: [windows-latest, ubuntu-latest, macos-latest]
|
|
runs-on: ${{ matrix.os }}
|
|
# Disable this job when running on a fork.
|
|
if: github.repository == 'bevyengine/bevy'
|
|
timeout-minutes: 30
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@beta
|
|
- name: Install Linux dependencies
|
|
uses: ./.github/actions/install-linux-deps
|
|
- name: Build & run tests
|
|
# See tools/ci/src/main.rs for the commands this runs
|
|
run: cargo run -p ci -- test
|
|
env:
|
|
CARGO_INCREMENTAL: 0
|
|
RUSTFLAGS: "-C debuginfo=0 -D warnings"
|
|
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
# Disable this job when running on a fork.
|
|
if: github.repository == 'bevyengine/bevy'
|
|
timeout-minutes: 30
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@beta
|
|
with:
|
|
components: rustfmt, clippy
|
|
- name: Install Linux dependencies
|
|
uses: ./.github/actions/install-linux-deps
|
|
with:
|
|
wayland: true
|
|
xkb: true
|
|
- name: Run lints
|
|
# See tools/ci/src/main.rs for the commands this runs
|
|
run: cargo run -p ci -- lints
|
|
|
|
check-compiles:
|
|
runs-on: ubuntu-latest
|
|
# Disable this job when running on a fork.
|
|
if: github.repository == 'bevyengine/bevy'
|
|
timeout-minutes: 30
|
|
needs: test
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@beta
|
|
- name: Install Linux dependencies
|
|
uses: ./.github/actions/install-linux-deps
|
|
- name: Check compile test
|
|
# See tools/ci/src/main.rs for the commands this runs
|
|
run: cargo run -p ci -- compile
|
|
|
|
open-issue:
|
|
name: Warn that weekly CI fails
|
|
runs-on: ubuntu-latest
|
|
needs: [test, lint, check-compiles]
|
|
permissions:
|
|
issues: write
|
|
# We disable this job on forks, because
|
|
# Use always() so the job doesn't get canceled if any other jobs fail
|
|
if: ${{ github.repository == 'bevyengine/bevy' && always() && contains(needs.*.result, 'failure') }}
|
|
steps:
|
|
- name: Create issue
|
|
run: |
|
|
previous_issue_number=$(gh issue list \
|
|
--search "$TITLE in:title" \
|
|
--json number \
|
|
--jq '.[0].number')
|
|
if [[ -n $previous_issue_number ]]; then
|
|
gh issue comment $previous_issue_number \
|
|
--body "Weekly pipeline still fails: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
|
|
else
|
|
gh issue create \
|
|
--title "$TITLE" \
|
|
--label "$LABELS" \
|
|
--body "$BODY"
|
|
fi
|
|
env:
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
GH_REPO: ${{ github.repository }}
|
|
TITLE: Main branch fails to compile on Rust beta.
|
|
LABELS: C-Bug,S-Needs-Triage
|
|
BODY: |
|
|
## Weekly CI run has failed.
|
|
[The offending run.](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})
|