Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Run scheduled CI jobs only on upstream repo
  • Loading branch information
ShaharNaveh committed Sep 20, 2025
commit 0c22ef3fa3a004a69cd2a15478e081d9f94665ee
8 changes: 8 additions & 0 deletions .github/workflows/cron-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ jobs:
codecov:
name: Collect code coverage data
runs-on: ubuntu-latest
# Disable this job when running on a fork.
if: github.repository == 'RustPython/RustPython'
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
Expand All @@ -44,6 +46,8 @@ jobs:
testdata:
name: Collect regression test data
runs-on: ubuntu-latest
# Disable this job when running on a fork.
if: github.repository == 'RustPython/RustPython'
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
Expand Down Expand Up @@ -73,6 +77,8 @@ jobs:
whatsleft:
name: Collect what is left data
runs-on: ubuntu-latest
# Disable this job when running on a fork.
if: github.repository == 'RustPython/RustPython'
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
Expand Down Expand Up @@ -111,6 +117,8 @@ jobs:
benchmark:
name: Collect benchmark data
runs-on: ubuntu-latest
# Disable this job when running on a fork.
if: github.repository == 'RustPython/RustPython'
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ env:
jobs:
build:
runs-on: ${{ matrix.platform.runner }}
# Disable this job when running on a fork.
if: github.repository == 'RustPython/RustPython'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Though I don't know well about actions. What if we need to edit release.yml? Then isn't it better to run it on the fork?

Copy link
Collaborator Author

@ShaharNaveh ShaharNaveh Sep 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Though I don't know well about actions. What if we need to edit release.yml? Then isn't it better to run it on the fork?

Not sure I understand your concern. this only prevents this job from triggering on RustPython forks, like mine:
https://github.com/ShaharNaveh/RustPython/actions/workflows/release.yml

I see that you disabled it manually for yourself lol:
https://github.com/youknowone/RustPython/actions/workflows/cron-ci.yaml

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that I get what you mean, we can have something like:

if: ${{ github.repository == 'RustPython/RustPython' || github.event_name != 'schedule' }}

this way it will always run on the upstream repo and can still be triggered with workflow_dispatch on forks

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I can't remember why I did it. Probably cron-ci was broken once a while ago. And never be fixed and forgotten.

The event_name check makes sense. Thanks!

strategy:
matrix:
platform:
Expand Down Expand Up @@ -88,6 +90,8 @@ jobs:

build-wasm:
runs-on: ubuntu-latest
# Disable this job when running on a fork.
if: github.repository == 'RustPython/RustPython'
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
Expand Down Expand Up @@ -136,6 +140,8 @@ jobs:

release:
runs-on: ubuntu-latest
# Disable this job when running on a fork.
if: github.repository == 'RustPython/RustPython'
needs: [build, build-wasm]
steps:
- name: Download Binary Artifacts
Expand Down
Loading