From 3465f73e2c02df6b7aee90e3fb6ae95afae416e3 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Wed, 13 Nov 2024 22:18:35 +0100 Subject: [PATCH 1/2] chore(ci): ROLE forgejo-coding & forgejo-testing When the CI vars.ROLE is forgejo-coding, it is assumed to be the repository where collaborative coding happens, i.e. https://codeberg.org/forgejo/forgejo When the CI vars.ROLE is forgejo-testing, it is assumed that only codebase testing is to be run and no other tests such as release build integration, label constraints, backporting etc. (cherry picked from commit f82840f1eafc155943f008ecd53cc10dcf00b9f1) Conflicts: .forgejo/workflows/merge-requirements.yml --- .forgejo/workflows/backport.yml | 2 +- .forgejo/workflows/build-release-integration.yml | 2 +- .forgejo/workflows/cascade-setup-end-to-end.yml | 2 +- .forgejo/workflows/release-notes-assistant-milestones.yml | 2 +- .forgejo/workflows/release-notes-assistant.yml | 2 +- .forgejo/workflows/renovate.yml | 2 +- .forgejo/workflows/testing.yml | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.forgejo/workflows/backport.yml b/.forgejo/workflows/backport.yml index 32a93edbc0..fca01a1acb 100644 --- a/.forgejo/workflows/backport.yml +++ b/.forgejo/workflows/backport.yml @@ -31,7 +31,7 @@ on: jobs: backporting: if: > - !startsWith(vars.ROLE, 'forgejo-') && ( + ( vars.ROLE == 'forgejo-coding' ) && ( github.event.pull_request.merged && contains(toJSON(github.event.pull_request.labels), 'backport/v') diff --git a/.forgejo/workflows/build-release-integration.yml b/.forgejo/workflows/build-release-integration.yml index f5f0d19da3..d10f40f7c7 100644 --- a/.forgejo/workflows/build-release-integration.yml +++ b/.forgejo/workflows/build-release-integration.yml @@ -22,7 +22,7 @@ on: jobs: release-simulation: - if: ${{ !startsWith(vars.ROLE, 'forgejo-') }} + if: vars.ROLE == 'forgejo-coding' runs-on: self-hosted steps: - uses: actions/checkout@v4 diff --git a/.forgejo/workflows/cascade-setup-end-to-end.yml b/.forgejo/workflows/cascade-setup-end-to-end.yml index 404bbe8fa6..0e206cbac4 100644 --- a/.forgejo/workflows/cascade-setup-end-to-end.yml +++ b/.forgejo/workflows/cascade-setup-end-to-end.yml @@ -24,7 +24,7 @@ on: jobs: info: - if: ${{ !startsWith(vars.ROLE, 'forgejo-') }} + if: vars.ROLE == 'forgejo-coding' runs-on: docker container: image: code.forgejo.org/oci/node:20-bookworm diff --git a/.forgejo/workflows/release-notes-assistant-milestones.yml b/.forgejo/workflows/release-notes-assistant-milestones.yml index dfe9a33a3c..c0bfa1ecf3 100644 --- a/.forgejo/workflows/release-notes-assistant-milestones.yml +++ b/.forgejo/workflows/release-notes-assistant-milestones.yml @@ -6,7 +6,7 @@ on: jobs: release-notes: - if: ${{ !startsWith(vars.ROLE, 'forgejo-') + if: vars.ROLE == 'forgejo-coding' runs-on: docker container: image: 'code.forgejo.org/oci/node:20-bookworm' diff --git a/.forgejo/workflows/release-notes-assistant.yml b/.forgejo/workflows/release-notes-assistant.yml index 3fed2d08d4..7c5ea51c17 100644 --- a/.forgejo/workflows/release-notes-assistant.yml +++ b/.forgejo/workflows/release-notes-assistant.yml @@ -7,7 +7,7 @@ on: jobs: release-notes: - if: ${{ !startsWith(vars.ROLE, 'forgejo-') && contains(github.event.pull_request.labels.*.name, 'worth a release-note') }} + if: ( vars.ROLE == 'forgejo-coding' ) && contains(github.event.pull_request.labels.*.name, 'worth a release-note') runs-on: docker container: image: 'code.forgejo.org/oci/node:20-bookworm' diff --git a/.forgejo/workflows/renovate.yml b/.forgejo/workflows/renovate.yml index 279e809ce9..dc69e1701b 100644 --- a/.forgejo/workflows/renovate.yml +++ b/.forgejo/workflows/renovate.yml @@ -21,7 +21,7 @@ env: jobs: renovate: - if: ${{ secrets.RENOVATE_TOKEN != '' }} + if: vars.ROLE == 'forgejo-coding' && secrets.RENOVATE_TOKEN != '' runs-on: docker container: diff --git a/.forgejo/workflows/testing.yml b/.forgejo/workflows/testing.yml index 563ff3b495..7b2eaaee6b 100644 --- a/.forgejo/workflows/testing.yml +++ b/.forgejo/workflows/testing.yml @@ -9,7 +9,7 @@ on: jobs: backend-checks: - if: ${{ !startsWith(vars.ROLE, 'forgejo-') }} + if: vars.ROLE == 'forgejo-coding' || vars.ROLE == 'forgejo-testing' runs-on: docker container: image: 'code.forgejo.org/oci/node:20-bookworm' From 78f69040fc9ab1d5adb3127fb5edb127316e9661 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Wed, 13 Nov 2024 22:59:51 +0100 Subject: [PATCH 2/2] chore(ci): ROLE forgejo-coding & forgejo-testing (part two) When the CI vars.ROLE is forgejo-coding, it is assumed to be the repository where collaborative coding happens, i.e. https://codeberg.org/forgejo/forgejo When the CI vars.ROLE is forgejo-testing, it is assumed that only codebase testing is to be run and no other tests such as release build integration, label constraints, backporting etc. (cherry picked from commit 068558accd1e47d02040495d870dcbd3f5d5ed9c) Conflicts: .forgejo/workflows/testing.yml was in .forgejo/workflows/e2e.yml --- .forgejo/workflows/cascade-setup-end-to-end.yml | 2 +- .forgejo/workflows/e2e.yml | 2 +- .forgejo/workflows/testing.yml | 14 +++++++------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.forgejo/workflows/cascade-setup-end-to-end.yml b/.forgejo/workflows/cascade-setup-end-to-end.yml index 0e206cbac4..f6f94980d1 100644 --- a/.forgejo/workflows/cascade-setup-end-to-end.yml +++ b/.forgejo/workflows/cascade-setup-end-to-end.yml @@ -44,7 +44,7 @@ jobs: cascade: if: > - !startsWith(vars.ROLE, 'forgejo-') && ( + vars.ROLE == 'forgejo-coding' && ( github.event_name == 'push' || ( github.event.action == 'label_updated' && contains(github.event.pull_request.labels.*.name, 'run-end-to-end-tests') diff --git a/.forgejo/workflows/e2e.yml b/.forgejo/workflows/e2e.yml index 9f2fbb0fa2..5e6348f54c 100644 --- a/.forgejo/workflows/e2e.yml +++ b/.forgejo/workflows/e2e.yml @@ -14,7 +14,7 @@ on: jobs: test-e2e: - if: ${{ !startsWith(vars.ROLE, 'forgejo-') }} + if: vars.ROLE == 'forgejo-coding' || vars.ROLE == 'forgejo-testing' runs-on: docker container: image: 'code.forgejo.org/oci/playwright:latest' diff --git a/.forgejo/workflows/testing.yml b/.forgejo/workflows/testing.yml index 7b2eaaee6b..5ddad294e1 100644 --- a/.forgejo/workflows/testing.yml +++ b/.forgejo/workflows/testing.yml @@ -34,7 +34,7 @@ jobs: path: '/workspace/forgejo/forgejo/gitea' key: backend-build-${{ github.sha }} frontend-checks: - if: ${{ !startsWith(vars.ROLE, 'forgejo-') }} + if: vars.ROLE == 'forgejo-coding' || vars.ROLE == 'forgejo-testing' runs-on: docker container: image: 'code.forgejo.org/oci/node:20-bookworm' @@ -46,7 +46,7 @@ jobs: - run: make test-frontend-coverage - run: make frontend test-unit: - if: ${{ !startsWith(vars.ROLE, 'forgejo-') }} + if: vars.ROLE == 'forgejo-coding' || vars.ROLE == 'forgejo-testing' runs-on: docker needs: [backend-checks, frontend-checks] container: @@ -106,7 +106,7 @@ jobs: TAGS: bindata TEST_ELASTICSEARCH_URL: http://elasticsearch:9200 test-remote-cacher: - if: ${{ !startsWith(vars.ROLE, 'forgejo-') }} + if: vars.ROLE == 'forgejo-coding' || vars.ROLE == 'forgejo-testing' runs-on: docker needs: [backend-checks, frontend-checks] container: @@ -167,7 +167,7 @@ jobs: TAGS: bindata TEST_REDIS_SERVER: cacher:${{ matrix.cacher.port }} test-mysql: - if: ${{ !startsWith(vars.ROLE, 'forgejo-') }} + if: vars.ROLE == 'forgejo-coding' || vars.ROLE == 'forgejo-testing' runs-on: docker needs: [backend-checks, frontend-checks] container: @@ -218,7 +218,7 @@ jobs: env: USE_REPO_TEST_DIR: 1 test-pgsql: - if: ${{ !startsWith(vars.ROLE, 'forgejo-') }} + if: vars.ROLE == 'forgejo-coding' || vars.ROLE == 'forgejo-testing' runs-on: docker needs: [backend-checks, frontend-checks] container: @@ -274,7 +274,7 @@ jobs: USE_REPO_TEST_DIR: 1 TEST_LDAP: 1 test-sqlite: - if: ${{ !startsWith(vars.ROLE, 'forgejo-') }} + if: vars.ROLE == 'forgejo-coding' || vars.ROLE == 'forgejo-testing' runs-on: docker needs: [backend-checks, frontend-checks] container: @@ -318,7 +318,7 @@ jobs: TEST_TAGS: sqlite sqlite_unlock_notify USE_REPO_TEST_DIR: 1 security-check: - if: ${{ !startsWith(vars.ROLE, 'forgejo-') }} + if: vars.ROLE == 'forgejo-coding' || vars.ROLE == 'forgejo-testing' runs-on: docker needs: - test-sqlite