From ca8ef18ff650c825752c420ead26b7f8573720c4 Mon Sep 17 00:00:00 2001 From: Cycloctane Date: Mon, 20 Oct 2025 07:29:34 +0800 Subject: [PATCH 01/11] 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 698a34302c7..0540f3bfb29 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: 9 From e7ff9756e2b341a5654abfa28e90a8baa268c1ce Mon Sep 17 00:00:00 2001 From: Cycloctane Date: Wed, 29 Oct 2025 14:48:44 +0800 Subject: [PATCH 02/11] 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 7612f832c2e96bf1e1cbe43eabbb7054b1cbf550 Mon Sep 17 00:00:00 2001 From: Cycloctane Date: Wed, 29 Oct 2025 16:23:45 +0800 Subject: [PATCH 03/11] 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 0540f3bfb29..fbb0637b564 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 e76f508c2d4856bb2a895ce49657763660152c74 Mon Sep 17 00:00:00 2001 From: Cycloctane Date: Wed, 29 Oct 2025 16:28:44 +0800 Subject: [PATCH 04/11] 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 fbb0637b564..68f16b9ab52 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: 9 From b0fcf0f5a692817ebb3bc188776fe4a8211ab443 Mon Sep 17 00:00:00 2001 From: Cycloctane Date: Wed, 29 Oct 2025 16:30:46 +0800 Subject: [PATCH 05/11] 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 ce2b9b3486497785f34a2fc43006de95a512c86f Mon Sep 17 00:00:00 2001 From: Cycloctane Date: Wed, 29 Oct 2025 16:40:07 +0800 Subject: [PATCH 06/11] 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 9fb6148cf001a872964e8f6da8ab84f7b38260e8 Mon Sep 17 00:00:00 2001 From: Cycloctane Date: Thu, 30 Oct 2025 21:57:24 +0800 Subject: [PATCH 07/11] 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 23bf28d8e9e577287e9f7fa9fca0b3a2a60dcc30 Mon Sep 17 00:00:00 2001 From: Cycloctane Date: Fri, 31 Oct 2025 02:11:29 +0800 Subject: [PATCH 08/11] 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 68f16b9ab52..c234bd7ec06 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: 9 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 e34866519fe6fc8d68e4f88a82e9e31354f94594 Mon Sep 17 00:00:00 2001 From: Cycloctane Date: Fri, 31 Oct 2025 02:21:55 +0800 Subject: [PATCH 09/11] 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 c234bd7ec06..a87797619bc 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: 9 @@ -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 425527bcf85f5196712ab418ad740385a4c5b24f 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/11] 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 a87797619bc..84aff56cf22 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 4da6f39fe8933090e80f6a4c4964cf939b2fc185 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/11] 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 84aff56cf22..8f089205ab3 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: |