Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
47 changes: 39 additions & 8 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,33 @@ env:
FORCE_COLOR: 1 # Request colored output from CLI tools supporting it
MYPY_FORCE_COLOR: 1
PY_COLORS: 1
UPSTREAM_REPOSITORY_ID: >-
13258039

permissions: {}

jobs:

pre-setup:
name: Pre-Setup global build settings
runs-on: ubuntu-latest
outputs:
upstream-repository-id: ${{ env.UPSTREAM_REPOSITORY_ID }}
release-requested: >-
${{
(
github.event_name == 'push'
&& github.ref_type == 'tag'
)
&& true
|| false
}}
steps:
- name: Dummy
if: false
run: |
echo "Pre-setup step"

lint:
permissions:
contents: read # to fetch code (actions/checkout)
Expand Down Expand Up @@ -148,7 +171,7 @@ jobs:
- os: windows
no-extensions: 'Y'
include:
- pyver: pypy-3.10
- pyver: pypy-3.11
no-extensions: 'Y'
os: ubuntu
experimental: false
Expand Down Expand Up @@ -259,8 +282,11 @@ jobs:

benchmark:
name: Benchmark
needs: gen_llhttp

needs:
- gen_llhttp
- pre-setup # transitive, for accessing settings
if: >-
needs.pre-setup.outputs.upstream-repository-id == github.repository_id
runs-on: ubuntu-latest
timeout-minutes: 12
steps:
Expand Down Expand Up @@ -295,7 +321,6 @@ jobs:
uses: CodSpeedHQ/action@v4
with:
mode: instrumentation
token: ${{ secrets.CODSPEED_TOKEN }}
run: python -Im pytest --no-cov --numprocesses=0 -vvvvv --codspeed


Expand All @@ -317,9 +342,10 @@ jobs:
pre-deploy:
name: Pre-Deploy
runs-on: ubuntu-latest
needs: check
# Run only on pushing a tag
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
needs:
- check
- pre-setup # transitive, for accessing settings
if: fromJSON(needs.pre-setup.outputs.release-requested)
steps:
- name: Dummy
run: |
Expand Down Expand Up @@ -465,8 +491,13 @@ jobs:

deploy:
name: Deploy
needs: [build-tarball, build-wheels]
needs:
- build-tarball
- build-wheels
- pre-setup # transitive, for accessing settings
runs-on: ubuntu-latest
if: >-
needs.pre-setup.outputs.upstream-repository-id == github.repository_id
Comment on lines +494 to +500
Copy link
Member

Choose a reason for hiding this comment

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

Could you move this to a separate PR?


permissions:
contents: write # IMPORTANT: mandatory for making GitHub Releases
Expand Down
3 changes: 3 additions & 0 deletions CHANGES/11737.contrib.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
The benchmark CI job now runs only in the upstream repository -- by :user:`Cycloctane`.

It used to always fail in forks, which this change fixed.
Loading