From 900307a3edf875644552b374b5a3a8242efda093 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/release-notes-assistant-milestones.yml .forgejo/workflows/release-notes-assistant.yml did not exist back in v7.0 --- .forgejo/workflows/backport.yml | 2 +- .forgejo/workflows/build-release-integration.yml | 2 +- .forgejo/workflows/cascade-setup-end-to-end.yml | 2 +- .forgejo/workflows/renovate.yml | 2 +- .forgejo/workflows/testing.yml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.forgejo/workflows/backport.yml b/.forgejo/workflows/backport.yml index a51633ed9b..c324e8aef3 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 610b8f0520..fe13c9606f 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@v3 diff --git a/.forgejo/workflows/cascade-setup-end-to-end.yml b/.forgejo/workflows/cascade-setup-end-to-end.yml index dcca2404d9..a4e3e0ac98 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: node:20-bookworm diff --git a/.forgejo/workflows/renovate.yml b/.forgejo/workflows/renovate.yml index 9af82e0ef4..5869dd0d1b 100644 --- a/.forgejo/workflows/renovate.yml +++ b/.forgejo/workflows/renovate.yml @@ -15,7 +15,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 125cb798dc..447b8d87a7 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: 'docker.io/node:20-bookworm' From 91ff7f332428feb10f37c7ad490c4f903837f5c7 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 e2e was in .forgejo/workflows/e2e.yml and some tests did not exist in v7.0 --- .forgejo/workflows/cascade-setup-end-to-end.yml | 2 +- .forgejo/workflows/e2e.yml | 2 +- .forgejo/workflows/testing.yml | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.forgejo/workflows/cascade-setup-end-to-end.yml b/.forgejo/workflows/cascade-setup-end-to-end.yml index a4e3e0ac98..b6cac09525 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 cda9991027..b998a8ed3e 100644 --- a/.forgejo/workflows/e2e.yml +++ b/.forgejo/workflows/e2e.yml @@ -11,7 +11,7 @@ on: jobs: test-e2e: - if: ${{ !startsWith(vars.ROLE, 'forgejo-') }} + if: vars.ROLE == 'forgejo-coding' || vars.ROLE == 'forgejo-testing' runs-on: docker container: image: 'docker.io/node:20-bookworm' diff --git a/.forgejo/workflows/testing.yml b/.forgejo/workflows/testing.yml index 447b8d87a7..82a947dd80 100644 --- a/.forgejo/workflows/testing.yml +++ b/.forgejo/workflows/testing.yml @@ -27,7 +27,7 @@ jobs: - run: make deps-backend deps-tools - run: make --always-make -j$(nproc) lint-backend checks-backend # ensure the "go-licenses" make target runs frontend-checks: - if: ${{ !startsWith(vars.ROLE, 'forgejo-') }} + if: vars.ROLE == 'forgejo-coding' || vars.ROLE == 'forgejo-testing' runs-on: docker container: image: 'docker.io/node:20-bookworm' @@ -39,7 +39,7 @@ jobs: - run: make test-frontend - 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: @@ -83,7 +83,7 @@ jobs: RACE_ENABLED: 'true' TAGS: bindata 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: @@ -129,7 +129,7 @@ jobs: TAGS: bindata 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: @@ -177,7 +177,7 @@ jobs: RACE_ENABLED: true USE_REPO_TEST_DIR: 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: