From 812fd752a782e8e9b4979c364e695f925739971a Mon Sep 17 00:00:00 2001 From: Cycloctane Date: Mon, 20 Oct 2025 07:29:34 +0800 Subject: [PATCH 01/13] skip codecov upload and benchmarks in forks --- .github/workflows/ci-cd.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 16303952219..38bd9f62724 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -233,12 +233,14 @@ jobs: run: pytest -m dev_mode --cov-append --numprocesses=0 shell: bash - name: Turn coverage into xml + if: github.repository_owner == 'aio-libs' env: COLOR: 'yes' PIP_USER: 1 run: | python -m coverage xml - name: Upload coverage + if: github.repository_owner == 'aio-libs' uses: codecov/codecov-action@v5 with: file: ./coverage.xml @@ -252,7 +254,7 @@ jobs: }} token: ${{ secrets.CODECOV_TOKEN }} - name: Upload test results to Codecov - if: ${{ !cancelled() }} + if: ${{ github.repository_owner == 'aio-libs' && !cancelled() }} uses: codecov/test-results-action@v1 with: token: ${{ secrets.CODECOV_TOKEN }} @@ -260,6 +262,7 @@ jobs: benchmark: name: Benchmark needs: gen_llhttp + if: github.repository_owner == 'aio-libs' runs-on: ubuntu-latest timeout-minutes: 12 From b705ecd3c3da469c80015f99e92cffd37e664fc0 Mon Sep 17 00:00:00 2001 From: Cycloctane Date: Wed, 29 Oct 2025 14:48:44 +0800 Subject: [PATCH 02/13] add changelog --- CHANGES/11737.contrib.rst | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 CHANGES/11737.contrib.rst diff --git a/CHANGES/11737.contrib.rst b/CHANGES/11737.contrib.rst new file mode 100644 index 00000000000..483538741c0 --- /dev/null +++ b/CHANGES/11737.contrib.rst @@ -0,0 +1,3 @@ +Fixed test and benchmark workflows always failing on forks. Made coverage upload +step and benchmark workflow skip when not running on main repository. +-- by :user:`Cycloctane`. From b2075badfab1d4d3e4caa51337489b7a83d28d69 Mon Sep 17 00:00:00 2001 From: Cycloctane Date: Wed, 29 Oct 2025 16:23:45 +0800 Subject: [PATCH 03/13] remove condition in test workflow --- .github/workflows/ci-cd.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 38bd9f62724..7a192e273f8 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -233,14 +233,12 @@ jobs: run: pytest -m dev_mode --cov-append --numprocesses=0 shell: bash - name: Turn coverage into xml - if: github.repository_owner == 'aio-libs' env: COLOR: 'yes' PIP_USER: 1 run: | python -m coverage xml - name: Upload coverage - if: github.repository_owner == 'aio-libs' uses: codecov/codecov-action@v5 with: file: ./coverage.xml @@ -254,7 +252,7 @@ jobs: }} token: ${{ secrets.CODECOV_TOKEN }} - name: Upload test results to Codecov - if: ${{ github.repository_owner == 'aio-libs' && !cancelled() }} + if: ${{ !cancelled() }} uses: codecov/test-results-action@v1 with: token: ${{ secrets.CODECOV_TOKEN }} From bd23653a60312fc7c1354276cd4c01844ae247a4 Mon Sep 17 00:00:00 2001 From: Cycloctane Date: Wed, 29 Oct 2025 16:28:44 +0800 Subject: [PATCH 04/13] use repository id instead of owner name --- .github/workflows/ci-cd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 7a192e273f8..de173e091be 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -260,7 +260,7 @@ jobs: benchmark: name: Benchmark needs: gen_llhttp - if: github.repository_owner == 'aio-libs' + if: github.repository_id == '13258039' runs-on: ubuntu-latest timeout-minutes: 12 From c0ed62cc3a9ad1ba346e67826f219a2697ab60a5 Mon Sep 17 00:00:00 2001 From: Cycloctane Date: Wed, 29 Oct 2025 16:30:46 +0800 Subject: [PATCH 05/13] update changelog --- CHANGES/11737.contrib.rst | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/CHANGES/11737.contrib.rst b/CHANGES/11737.contrib.rst index 483538741c0..300c83c4f76 100644 --- a/CHANGES/11737.contrib.rst +++ b/CHANGES/11737.contrib.rst @@ -1,3 +1,2 @@ -Fixed test and benchmark workflows always failing on forks. Made coverage upload -step and benchmark workflow skip when not running on main repository. --- by :user:`Cycloctane`. +Fixed ci workflow always failing on forks. Made benchmark skip when not +running on main repository. -- by :user:`Cycloctane`. From ca17839d8fd695f2911986c6ba970af86ee64396 Mon Sep 17 00:00:00 2001 From: Cycloctane Date: Wed, 29 Oct 2025 16:40:07 +0800 Subject: [PATCH 06/13] update changelog --- CHANGES/11737.contrib.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES/11737.contrib.rst b/CHANGES/11737.contrib.rst index 300c83c4f76..67e1a965e01 100644 --- a/CHANGES/11737.contrib.rst +++ b/CHANGES/11737.contrib.rst @@ -1,2 +1,2 @@ -Fixed ci workflow always failing on forks. Made benchmark skip when not +Fixed workflow always failing on forks. Made benchmark job skip when not running on main repository. -- by :user:`Cycloctane`. From eade60a82edba62d3177fe929daf2dba88d0e02e Mon Sep 17 00:00:00 2001 From: Cycloctane Date: Thu, 30 Oct 2025 21:57:24 +0800 Subject: [PATCH 07/13] Update CHANGES/11737.contrib.rst MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) --- CHANGES/11737.contrib.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGES/11737.contrib.rst b/CHANGES/11737.contrib.rst index 67e1a965e01..2b793f41d6c 100644 --- a/CHANGES/11737.contrib.rst +++ b/CHANGES/11737.contrib.rst @@ -1,2 +1,3 @@ -Fixed workflow always failing on forks. Made benchmark job skip when not -running on main repository. -- by :user:`Cycloctane`. +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. From 0b9f6026f67e23fa1a8c1a68d3db0f6de4c19f82 Mon Sep 17 00:00:00 2001 From: Cycloctane Date: Fri, 31 Oct 2025 02:11:29 +0800 Subject: [PATCH 08/13] update ci-cd --- .github/workflows/ci-cd.yml | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index de173e091be..dccd6519268 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -23,10 +23,25 @@ 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' && contains(github.ref, 'refs/tags/') }} + steps: + - name: Dummy + run: | + echo "Pre-setup step" + lint: permissions: contents: read # to fetch code (actions/checkout) @@ -259,9 +274,9 @@ jobs: benchmark: name: Benchmark - needs: gen_llhttp - if: github.repository_id == '13258039' - + needs: [pre-setup, gen_llhttp] + if: | + needs.pre-setup.outputs.upstream-repository-id == github.repository_id runs-on: ubuntu-latest timeout-minutes: 12 steps: @@ -318,9 +333,8 @@ 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: [pre-setup, check] + if: fromJSON(needs.pre-setup.outputs.release-requested) steps: - name: Dummy run: | @@ -466,8 +480,10 @@ jobs: deploy: name: Deploy - needs: [build-tarball, build-wheels] + needs: [pre-setup, build-tarball, build-wheels] runs-on: ubuntu-latest + if: | + needs.pre-setup.outputs.upstream-repository-id == github.repository_id permissions: contents: write # IMPORTANT: mandatory for making GitHub Releases From ae92397d9f41df6d6c1e3f4fb8b36bc9ac99eb20 Mon Sep 17 00:00:00 2001 From: Cycloctane Date: Fri, 31 Oct 2025 02:21:55 +0800 Subject: [PATCH 09/13] fix syntax --- .github/workflows/ci-cd.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index dccd6519268..b5874403240 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -23,7 +23,7 @@ env: FORCE_COLOR: 1 # Request colored output from CLI tools supporting it MYPY_FORCE_COLOR: 1 PY_COLORS: 1 - UPSTREAM_REPOSITORY_ID: | + UPSTREAM_REPOSITORY_ID: >- 13258039 permissions: {} @@ -35,7 +35,7 @@ jobs: runs-on: ubuntu-latest outputs: upstream-repository-id: ${{ env.UPSTREAM_REPOSITORY_ID }} - release-requested: | + release-requested: >- ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags/') }} steps: - name: Dummy @@ -275,7 +275,7 @@ jobs: benchmark: name: Benchmark needs: [pre-setup, gen_llhttp] - if: | + if: >- needs.pre-setup.outputs.upstream-repository-id == github.repository_id runs-on: ubuntu-latest timeout-minutes: 12 @@ -482,7 +482,7 @@ jobs: name: Deploy needs: [pre-setup, build-tarball, build-wheels] runs-on: ubuntu-latest - if: | + if: >- needs.pre-setup.outputs.upstream-repository-id == github.repository_id permissions: From 5c1d66df112a43f0ab3d421e173c2016827109a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=F0=9F=87=BA=F0=9F=87=A6=20Sviatoslav=20Sydorenko=20=28?= =?UTF-8?q?=D0=A1=D0=B2=D1=8F=D1=82=D0=BE=D1=81=D0=BB=D0=B0=D0=B2=20=D0=A1?= =?UTF-8?q?=D0=B8=D0=B4=D0=BE=D1=80=D0=B5=D0=BD=D0=BA=D0=BE=29?= Date: Wed, 5 Nov 2025 13:46:29 +0100 Subject: [PATCH 10/13] Annotate transitive job deps with context comments --- .github/workflows/ci-cd.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index b5874403240..f0637e7c821 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -274,7 +274,9 @@ jobs: benchmark: name: Benchmark - needs: [pre-setup, 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 @@ -333,7 +335,9 @@ jobs: pre-deploy: name: Pre-Deploy runs-on: ubuntu-latest - needs: [pre-setup, check] + needs: + - check + - pre-setup # transitive, for accessing settings if: fromJSON(needs.pre-setup.outputs.release-requested) steps: - name: Dummy @@ -480,7 +484,10 @@ jobs: deploy: name: Deploy - needs: [pre-setup, 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 From 3eafe551ba0c838e7b97a719c4f06a6653ea491a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=F0=9F=87=BA=F0=9F=87=A6=20Sviatoslav=20Sydorenko=20=28?= =?UTF-8?q?=D0=A1=D0=B2=D1=8F=D1=82=D0=BE=D1=81=D0=BB=D0=B0=D0=B2=20=D0=A1?= =?UTF-8?q?=D0=B8=D0=B4=D0=BE=D1=80=D0=B5=D0=BD=D0=BA=D0=BE=29?= Date: Wed, 5 Nov 2025 13:46:58 +0100 Subject: [PATCH 11/13] Add an explicit ternary for the `release-requested` value --- .github/workflows/ci-cd.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index f0637e7c821..d1dbf377d0e 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -36,7 +36,14 @@ jobs: outputs: upstream-repository-id: ${{ env.UPSTREAM_REPOSITORY_ID }} release-requested: >- - ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags/') }} + ${{ + ( + github.event_name == 'push' + && github.ref_type == 'tag' + ) + && true + || false + }} steps: - name: Dummy run: | From cdbcb60b0d65cb6305053c5f4c8c2e6a59e5b7df Mon Sep 17 00:00:00 2001 From: Rui Xi Date: Mon, 17 Nov 2025 05:08:24 +0800 Subject: [PATCH 12/13] Remove codspeed token from CI/CD benchmarks step --- .github/workflows/ci-cd.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index d1dbf377d0e..85de6e75756 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -320,7 +320,6 @@ jobs: uses: CodSpeedHQ/action@v4 with: mode: instrumentation - token: ${{ secrets.CODSPEED_TOKEN }} run: python -Im pytest --no-cov --numprocesses=0 -vvvvv --codspeed From 6dc6b3ebf5afd04bd23e1461e3d3d1b845e50784 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=F0=9F=87=BA=F0=9F=87=A6=20Sviatoslav=20Sydorenko=20=28?= =?UTF-8?q?=D0=A1=D0=B2=D1=8F=D1=82=D0=BE=D1=81=D0=BB=D0=B0=D0=B2=20=D0=A1?= =?UTF-8?q?=D0=B8=D0=B4=D0=BE=D1=80=D0=B5=D0=BD=D0=BA=D0=BE=29?= Date: Fri, 21 Nov 2025 17:39:58 +0100 Subject: [PATCH 13/13] Always skip the dummy step in pre-setup --- .github/workflows/ci-cd.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 85de6e75756..0f983719ba0 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -46,6 +46,7 @@ jobs: }} steps: - name: Dummy + if: false run: | echo "Pre-setup step"