From e315dddcae051ceb14442952050f39bae8503297 Mon Sep 17 00:00:00 2001 From: silverwind Date: Thu, 8 Jun 2023 12:06:24 +0200 Subject: [PATCH 1/7] GitHub Actions enhancements --- .github/workflows/pull-compliance.yml | 6 +----- .github/workflows/pull-db-tests.yml | 10 +++++----- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/.github/workflows/pull-compliance.yml b/.github/workflows/pull-compliance.yml index b7c1ab8a33c82..5d9ce95da2390 100644 --- a/.github/workflows/pull-compliance.yml +++ b/.github/workflows/pull-compliance.yml @@ -83,6 +83,7 @@ jobs: - run: make deps-frontend - run: make lint-frontend - run: make checks-frontend + - run: make frontend backend: if: needs.files-changed.outputs.backend == 'true' @@ -94,12 +95,7 @@ jobs: with: go-version: ">=1.20" check-latest: true - - uses: actions/setup-node@v3 - with: - node-version: 20 - run: make deps-backend deps-tools - - run: make deps-frontend - - run: make frontend - run: go build -o gitea_no_gcc # test if build succeeds without the sqlite tag - name: build-backend-arm64 run: make backend # test cross compile diff --git a/.github/workflows/pull-db-tests.yml b/.github/workflows/pull-db-tests.yml index cf08da151246b..56648425dbd7e 100644 --- a/.github/workflows/pull-db-tests.yml +++ b/.github/workflows/pull-db-tests.yml @@ -12,7 +12,7 @@ jobs: uses: ./.github/workflows/files-changed.yml test-pgsql: - if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.frontend == 'true' + if: needs.files-changed.outputs.backend == 'true' needs: files-changed runs-on: ubuntu-latest services: @@ -58,7 +58,7 @@ jobs: USE_REPO_TEST_DIR: 1 test-sqlite: - if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.frontend == 'true' + if: needs.files-changed.outputs.backend == 'true' needs: files-changed runs-on: ubuntu-latest steps: @@ -144,7 +144,7 @@ jobs: GITHUB_READ_TOKEN: ${{ secrets.GITHUB_READ_TOKEN }} test-mysql5: - if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.frontend == 'true' + if: needs.files-changed.outputs.backend == 'true' needs: files-changed runs-on: ubuntu-latest services: @@ -188,7 +188,7 @@ jobs: TEST_INDEXER_CODE_ES_URL: "http://elastic:changeme@elasticsearch:9200" test-mysql8: - if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.frontend == 'true' + if: needs.files-changed.outputs.backend == 'true' needs: files-changed runs-on: ubuntu-latest services: @@ -217,7 +217,7 @@ jobs: USE_REPO_TEST_DIR: 1 test-mssql: - if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.frontend == 'true' + if: needs.files-changed.outputs.backend == 'true' needs: files-changed runs-on: ubuntu-latest services: From 03c5dc19c5e12cd39edce23f344f2bf7296df492 Mon Sep 17 00:00:00 2001 From: silverwind Date: Thu, 8 Jun 2023 12:16:33 +0200 Subject: [PATCH 2/7] add comment about missing frontend build --- .github/workflows/pull-compliance.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pull-compliance.yml b/.github/workflows/pull-compliance.yml index 5d9ce95da2390..3f6300bd25c26 100644 --- a/.github/workflows/pull-compliance.yml +++ b/.github/workflows/pull-compliance.yml @@ -95,6 +95,8 @@ jobs: with: go-version: ">=1.20" check-latest: true + # no frontend build here as backend should be able to build + # even without any frontend files - run: make deps-backend deps-tools - run: go build -o gitea_no_gcc # test if build succeeds without the sqlite tag - name: build-backend-arm64 From 2fdd64992d854868344801267d93319e17edb8f1 Mon Sep 17 00:00:00 2001 From: silverwind Date: Thu, 8 Jun 2023 12:54:26 +0200 Subject: [PATCH 3/7] frontend change --- web_src/js/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/web_src/js/index.js b/web_src/js/index.js index 0c786f96fbef2..6ad58e156146a 100644 --- a/web_src/js/index.js +++ b/web_src/js/index.js @@ -1,6 +1,7 @@ // bootstrap module must be the first one to be imported, it handles webpack lazy-loading and global errors import './bootstrap.js'; + import {initRepoActivityTopAuthorsChart} from './components/RepoActivityTopAuthors.vue'; import {initScopedAccessTokenCategories} from './components/ScopedAccessTokenSelector.vue'; import {initDashboardRepoList} from './components/DashboardRepoList.vue'; From 487520bdfd7ac802dfa7f657faa1e64414811223 Mon Sep 17 00:00:00 2001 From: silverwind Date: Thu, 8 Jun 2023 14:52:39 +0200 Subject: [PATCH 4/7] Revert "frontend change" This reverts commit 2fdd64992d854868344801267d93319e17edb8f1. --- web_src/js/index.js | 1 - 1 file changed, 1 deletion(-) diff --git a/web_src/js/index.js b/web_src/js/index.js index 6ad58e156146a..0c786f96fbef2 100644 --- a/web_src/js/index.js +++ b/web_src/js/index.js @@ -1,7 +1,6 @@ // bootstrap module must be the first one to be imported, it handles webpack lazy-loading and global errors import './bootstrap.js'; - import {initRepoActivityTopAuthorsChart} from './components/RepoActivityTopAuthors.vue'; import {initScopedAccessTokenCategories} from './components/ScopedAccessTokenSelector.vue'; import {initDashboardRepoList} from './components/DashboardRepoList.vue'; From ff74fe351978e0abaa95432ed3ec92c4b6ed7fae Mon Sep 17 00:00:00 2001 From: silverwind Date: Thu, 8 Jun 2023 14:52:56 +0200 Subject: [PATCH 5/7] backend change --- templates/home.tmpl | 1 + 1 file changed, 1 insertion(+) diff --git a/templates/home.tmpl b/templates/home.tmpl index 1f10f3c8d2ad8..8c08a3d229d63 100644 --- a/templates/home.tmpl +++ b/templates/home.tmpl @@ -1,4 +1,5 @@ {{template "base/head" .}} +
From 564fad261571cd4b27ceffb7fd917be046b2fa14 Mon Sep 17 00:00:00 2001 From: silverwind Date: Thu, 8 Jun 2023 18:04:45 +0200 Subject: [PATCH 6/7] gevert "backend change" This reverts commit ff74fe351978e0abaa95432ed3ec92c4b6ed7fae. --- templates/home.tmpl | 1 - 1 file changed, 1 deletion(-) diff --git a/templates/home.tmpl b/templates/home.tmpl index 8c08a3d229d63..1f10f3c8d2ad8 100644 --- a/templates/home.tmpl +++ b/templates/home.tmpl @@ -1,5 +1,4 @@ {{template "base/head" .}} -
From 4272c78e65ac8e1c711a70f52f34aaf310ee0c94 Mon Sep 17 00:00:00 2001 From: silverwind Date: Fri, 9 Jun 2023 16:55:09 +0200 Subject: [PATCH 7/7] add actions conditions to all pull jobs --- .github/workflows/pull-compliance.yml | 16 ++++++++-------- .github/workflows/pull-db-tests.yml | 12 ++++++------ .github/workflows/pull-docker-dryrun.yml | 2 +- .github/workflows/pull-e2e-tests.yml | 2 +- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/pull-compliance.yml b/.github/workflows/pull-compliance.yml index 3f6300bd25c26..daee522c2744a 100644 --- a/.github/workflows/pull-compliance.yml +++ b/.github/workflows/pull-compliance.yml @@ -12,7 +12,7 @@ jobs: uses: ./.github/workflows/files-changed.yml lint-backend: - if: needs.files-changed.outputs.backend == 'true' + if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true' needs: files-changed runs-on: ubuntu-latest steps: @@ -27,7 +27,7 @@ jobs: TAGS: bindata sqlite sqlite_unlock_notify lint-go-windows: - if: needs.files-changed.outputs.backend == 'true' + if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true' needs: files-changed runs-on: ubuntu-latest steps: @@ -44,7 +44,7 @@ jobs: GOARCH: amd64 lint-go-gogit: - if: needs.files-changed.outputs.backend == 'true' + if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true' needs: files-changed runs-on: ubuntu-latest steps: @@ -59,7 +59,7 @@ jobs: TAGS: bindata gogit sqlite sqlite_unlock_notify checks-backend: - if: needs.files-changed.outputs.backend == 'true' + if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true' needs: files-changed runs-on: ubuntu-latest steps: @@ -72,7 +72,7 @@ jobs: - run: make --always-make checks-backend # ensure the "go-licenses" make target runs frontend: - if: needs.files-changed.outputs.frontend == 'true' + if: needs.files-changed.outputs.frontend == 'true' || needs.files-changed.outputs.actions == 'true' needs: files-changed runs-on: ubuntu-latest steps: @@ -86,7 +86,7 @@ jobs: - run: make frontend backend: - if: needs.files-changed.outputs.backend == 'true' + if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true' needs: files-changed runs-on: ubuntu-latest steps: @@ -118,7 +118,7 @@ jobs: GOARCH: 386 docs: - if: needs.files-changed.outputs.docs == 'true' + if: needs.files-changed.outputs.docs == 'true' || needs.files-changed.outputs.actions == 'true' needs: files-changed runs-on: ubuntu-latest steps: @@ -131,7 +131,7 @@ jobs: - run: make docs # test if build could succeed actions: - if: needs.files-changed.outputs.actions == 'true' + if: needs.files-changed.outputs.actions == 'true' || needs.files-changed.outputs.actions == 'true' needs: files-changed runs-on: ubuntu-latest steps: diff --git a/.github/workflows/pull-db-tests.yml b/.github/workflows/pull-db-tests.yml index 409f60bf8d5d9..12e5e64e80763 100644 --- a/.github/workflows/pull-db-tests.yml +++ b/.github/workflows/pull-db-tests.yml @@ -12,7 +12,7 @@ jobs: uses: ./.github/workflows/files-changed.yml test-pgsql: - if: needs.files-changed.outputs.backend == 'true' + if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true' needs: files-changed runs-on: ubuntu-latest services: @@ -59,7 +59,7 @@ jobs: USE_REPO_TEST_DIR: 1 test-sqlite: - if: needs.files-changed.outputs.backend == 'true' + if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true' needs: files-changed runs-on: ubuntu-latest steps: @@ -81,7 +81,7 @@ jobs: USE_REPO_TEST_DIR: 1 test-unit: - if: needs.files-changed.outputs.backend == 'true' + if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true' needs: files-changed runs-on: ubuntu-latest services: @@ -147,7 +147,7 @@ jobs: GITHUB_READ_TOKEN: ${{ secrets.GITHUB_READ_TOKEN }} test-mysql5: - if: needs.files-changed.outputs.backend == 'true' + if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true' needs: files-changed runs-on: ubuntu-latest services: @@ -192,7 +192,7 @@ jobs: TEST_INDEXER_CODE_ES_URL: "http://elastic:changeme@elasticsearch:9200" test-mysql8: - if: needs.files-changed.outputs.backend == 'true' + if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true' needs: files-changed runs-on: ubuntu-latest services: @@ -222,7 +222,7 @@ jobs: USE_REPO_TEST_DIR: 1 test-mssql: - if: needs.files-changed.outputs.backend == 'true' + if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true' needs: files-changed runs-on: ubuntu-latest services: diff --git a/.github/workflows/pull-docker-dryrun.yml b/.github/workflows/pull-docker-dryrun.yml index 89b0c5253c371..916de6b27d35c 100644 --- a/.github/workflows/pull-docker-dryrun.yml +++ b/.github/workflows/pull-docker-dryrun.yml @@ -12,7 +12,7 @@ jobs: uses: ./.github/workflows/files-changed.yml docker-dryrun: - if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.frontend == 'true' + if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.frontend == 'true' || needs.files-changed.outputs.actions == 'true' needs: files-changed runs-on: ubuntu-latest steps: diff --git a/.github/workflows/pull-e2e-tests.yml b/.github/workflows/pull-e2e-tests.yml index cf6af401f5eae..6577cfd2400cf 100644 --- a/.github/workflows/pull-e2e-tests.yml +++ b/.github/workflows/pull-e2e-tests.yml @@ -12,7 +12,7 @@ jobs: uses: ./.github/workflows/files-changed.yml test-e2e: - if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.frontend == 'true' + if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.frontend == 'true' || needs.files-changed.outputs.actions == 'true' needs: files-changed runs-on: ubuntu-latest steps: