From 6c8b680f91a65ffe0401ac95cfba1737decd3977 Mon Sep 17 00:00:00 2001 From: silverwind Date: Fri, 12 May 2023 03:21:28 +0200 Subject: GitHub Actions cleanups (#24620) - Remove actions name where command is descriptive enough - Use kebab-case instead of snake-case for step names - Use shorter job names because to make PR checks more readable - Remove duplicate `checks-backend` --------- Co-authored-by: Yarden Shoham --- .github/workflows/cron-licenses.yml | 17 +- .github/workflows/cron-lock.yml | 21 +++ .github/workflows/cron-translations.yml | 14 +- .github/workflows/lock.yml | 21 --- .github/workflows/publish-docs.yml | 29 +++ .github/workflows/pull-compliance-docs.yml | 22 +++ .github/workflows/pull-compliance.yml | 119 ++++--------- .github/workflows/pull-compliance_docs.yml | 26 --- .github/workflows/pull-db-tests.yml | 224 +++++++++++++++++++++++ .github/workflows/pull-db_test.yml | 274 ----------------------------- .github/workflows/pull-docker-dryrun.yml | 17 ++ .github/workflows/pull-docker_dryrun.yml | 23 --- .github/workflows/pull-e2e-tests.yml | 26 +++ .github/workflows/pull-e2e.yml | 33 ---- .github/workflows/push-publish_docs.yml | 31 ---- Makefile | 4 +- 16 files changed, 393 insertions(+), 508 deletions(-) create mode 100644 .github/workflows/cron-lock.yml delete mode 100644 .github/workflows/lock.yml create mode 100644 .github/workflows/publish-docs.yml create mode 100644 .github/workflows/pull-compliance-docs.yml delete mode 100644 .github/workflows/pull-compliance_docs.yml create mode 100644 .github/workflows/pull-db-tests.yml delete mode 100644 .github/workflows/pull-db_test.yml create mode 100644 .github/workflows/pull-docker-dryrun.yml delete mode 100644 .github/workflows/pull-docker_dryrun.yml create mode 100644 .github/workflows/pull-e2e-tests.yml delete mode 100644 .github/workflows/pull-e2e.yml delete mode 100644 .github/workflows/push-publish_docs.yml diff --git a/.github/workflows/cron-licenses.yml b/.github/workflows/cron-licenses.yml index 7239078710..54702f4682 100644 --- a/.github/workflows/cron-licenses.yml +++ b/.github/workflows/cron-licenses.yml @@ -1,21 +1,20 @@ -name: "Cron: Update licenses and gitignores" +name: cron-licenses on: schedule: - # weekly on Monday at 0:07 UTC - - cron: "7 0 * * 1" + - cron: "7 0 * * 1" # every Monday at 00:07 UTC jobs: - cron: + cron-licenses: + if: github.repository == "go-gitea/gitea" runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v3 + - uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version: '>=1.20.1' - - name: update licenses and gitignores - run: timeout -s ABRT 40m make generate-license generate-gitignore + go-version: ">=1.20.1" + - run: make generate-license generate-gitignore + timeout-minutes: 40 - name: push translations to repo uses: appleboy/git-push-action@v0.0.2 with: diff --git a/.github/workflows/cron-lock.yml b/.github/workflows/cron-lock.yml new file mode 100644 index 0000000000..e11869058c --- /dev/null +++ b/.github/workflows/cron-lock.yml @@ -0,0 +1,21 @@ +name: cron-lock + +on: + schedule: + - cron: "0 0 * * *" # every day at 00:00 UTC + workflow_dispatch: + +permissions: + issues: write + pull-requests: write + +concurrency: + group: lock + +jobs: + action: + runs-on: ubuntu-latest + steps: + - uses: dessant/lock-threads@v4 + with: + issue-inactive-days: 45 diff --git a/.github/workflows/cron-translations.yml b/.github/workflows/cron-translations.yml index c83450d2e6..97e1ff9739 100644 --- a/.github/workflows/cron-translations.yml +++ b/.github/workflows/cron-translations.yml @@ -1,15 +1,14 @@ -name: "Cron: Pull translations from Crowdin" +name: cron-translations on: schedule: - - cron: "7 0 * * *" # every day at 0:07 UTC + - cron: "7 0 * * *" # every day at 00:07 UTC jobs: - crowdin_pull: + crowdin-pull: runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v3 + - uses: actions/checkout@v3 - name: download from crowdin uses: docker://jonasfranz/crowdin env: @@ -30,11 +29,10 @@ jobs: commit_message: "[skip ci] Updated translations via Crowdin" remote: "git@github.com:go-gitea/gitea.git" ssh_key: ${{ secrets.DEPLOY_KEY }} - crowdin_push: + crowdin-push: runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v3 + - uses: actions/checkout@v3 - name: push translations to crowdin uses: docker://jonasfranz/crowdin env: diff --git a/.github/workflows/lock.yml b/.github/workflows/lock.yml deleted file mode 100644 index 2e132b95fe..0000000000 --- a/.github/workflows/lock.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: 'Lock Threads' - -on: - schedule: - - cron: '0 0 * * *' # Run once a day - workflow_dispatch: - -permissions: - issues: write - pull-requests: write - -concurrency: - group: lock - -jobs: - action: - runs-on: ubuntu-latest - steps: - - uses: dessant/lock-threads@v4 - with: - issue-inactive-days: 45 diff --git a/.github/workflows/publish-docs.yml b/.github/workflows/publish-docs.yml new file mode 100644 index 0000000000..de5572a640 --- /dev/null +++ b/.github/workflows/publish-docs.yml @@ -0,0 +1,29 @@ +name: publish-docs + +on: + push: + paths: + - "docs/**" + branches: + - main + +jobs: + compliance-docs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-go@v4 + with: + go-version: ">=1.20.1" + - name: build docs + run: | + cd docs + make trans-copy clean build + - name: publish to netlify + uses: nwtgck/actions-netlify@v2.0 + with: + production-branch: main + publish-dir: docs/public/ + env: + NETLIFY_SITE_ID: d2260bae-7861-4c02-8646-8f6440b12672 + NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} diff --git a/.github/workflows/pull-compliance-docs.yml b/.github/workflows/pull-compliance-docs.yml new file mode 100644 index 0000000000..44db6d67af --- /dev/null +++ b/.github/workflows/pull-compliance-docs.yml @@ -0,0 +1,22 @@ +name: compliance-docs + +on: + pull_request: + paths: + - "docs/**" + - "*.md" + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + compliance-docs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 20 + - run: make deps-frontend + - run: make lint-md diff --git a/.github/workflows/pull-compliance.yml b/.github/workflows/pull-compliance.yml index 155d9298e9..88342e67d6 100644 --- a/.github/workflows/pull-compliance.yml +++ b/.github/workflows/pull-compliance.yml @@ -1,4 +1,4 @@ -name: "Pull: Compliance Tests" +name: compliance on: [pull_request] @@ -7,136 +7,93 @@ concurrency: cancel-in-progress: true jobs: - lint_basic: + lint-backend: runs-on: ubuntu-latest steps: - - name: checkout - uses: actions/checkout@v3 - - name: setup go - uses: actions/setup-go@v4 + - uses: actions/checkout@v3 + - uses: actions/setup-go@v4 with: - go-version: '>=1.20' + go-version: ">=1.20" check-latest: true - - name: deps-backend - run: make deps-backend deps-tools - - name: lint backend - run: make lint-backend + - run: make deps-backend deps-tools + - run: make lint-backend env: - GOPROXY: https://goproxy.io # proxy.golang.org is blocked in China, this proxy is not - GOSUMDB: sum.golang.org TAGS: bindata sqlite sqlite_unlock_notify - lint_windows: + lint-go-windows: runs-on: ubuntu-latest steps: - - name: checkout - uses: actions/checkout@v3 - - name: setup go - uses: actions/setup-go@v4 + - uses: actions/checkout@v3 + - uses: actions/setup-go@v4 with: - go-version: '>=1.20' + go-version: ">=1.20" check-latest: true - - name: deps-backend - run: make deps-backend deps-tools - - name: lint-backend-windows - run: make lint-go-windows lint-go-vet + - run: make deps-backend deps-tools + - run: make lint-go-windows lint-go-vet env: - GOPROXY: https://goproxy.io # proxy.golang.org is blocked in China, this proxy is not - GOSUMDB: sum.golang.org TAGS: bindata sqlite sqlite_unlock_notify GOOS: windows GOARCH: amd64 - lint_gogit: + lint-go-gogit: runs-on: ubuntu-latest steps: - - name: checkout - uses: actions/checkout@v3 - - name: setup go - uses: actions/setup-go@v4 + - uses: actions/checkout@v3 + - uses: actions/setup-go@v4 with: - go-version: '>=1.20' + go-version: ">=1.20" check-latest: true - - name: deps-backend - run: make deps-backend deps-tools - - name: lint-backend-gogit - run: make lint-backend + - run: make deps-backend deps-tools + - run: make lint-go env: - GOPROXY: https://goproxy.io # proxy.golang.org is blocked in China, this proxy is not - GOSUMDB: sum.golang.org TAGS: bindata gogit sqlite sqlite_unlock_notify - - name: checks backend - run: make --always-make checks-backend # ensure the 'go-licenses' make target runs - check_backend: + checks-backend: runs-on: ubuntu-latest steps: - - name: checkout - uses: actions/checkout@v3 - - name: setup go - uses: actions/setup-go@v4 + - uses: actions/checkout@v3 + - uses: actions/setup-go@v4 with: - go-version: '>=1.20' + go-version: ">=1.20" check-latest: true - - name: deps-backend - run: make deps-backend deps-tools - - name: checks backend - run: make --always-make checks-backend # ensure the 'go-licenses' make target runs + - run: make deps-backend deps-tools + - run: make --always-make checks-backend # ensure the "go-licenses" make target runs frontend: runs-on: ubuntu-latest steps: - - name: checkout - uses: actions/checkout@v3 - - name: setup node - uses: actions/setup-node@v3 + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 with: node-version: 20 - - name: deps-frontend - run: make deps-frontend - - name: lint frontend - run: make lint-frontend - - name: checks frontend - run: make checks-frontend - - name: test frontend - run: make test-frontend + - run: make deps-frontend + - run: make lint-frontend + - run: make checks-frontend backend: runs-on: ubuntu-latest steps: - - name: checkout - uses: actions/checkout@v3 - - name: setup go - uses: actions/setup-go@v4 + - uses: actions/checkout@v3 + - uses: actions/setup-go@v4 with: - go-version: '>=1.20' + go-version: ">=1.20" check-latest: true - - name: setup node - uses: actions/setup-node@v3 + - uses: actions/setup-node@v3 with: node-version: 20 - - name: deps-backend - run: make deps-backend deps-tools - - name: deps-frontend - run: make deps-frontend - - name: build frontend - run: make frontend - - name: build-backend-no-gcc - run: go build -o gitea_no_gcc # test if build succeeds without the sqlite tag - env: - GOPROXY: https://goproxy.io + - 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 env: - GOPROXY: https://goproxy.io GOOS: linux GOARCH: arm64 TAGS: bindata gogit - name: build-backend-windows run: go build -o gitea_windows env: - GOPROXY: https://goproxy.io GOOS: windows GOARCH: amd64 TAGS: bindata gogit - name: build-backend-386 run: go build -o gitea_linux_386 # test if compatible with 32 bit env: - GOPROXY: https://goproxy.io GOOS: linux GOARCH: 386 diff --git a/.github/workflows/pull-compliance_docs.yml b/.github/workflows/pull-compliance_docs.yml deleted file mode 100644 index c033b62711..0000000000 --- a/.github/workflows/pull-compliance_docs.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: "Pull: Compliance testing for documentation" - -on: - pull_request: - paths: - - "docs/**" - - "*.md" - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - compliance-docs: - runs-on: ubuntu-latest - steps: - - name: checkout - uses: actions/checkout@v3 - - name: setup node - uses: actions/setup-node@v3 - with: - node-version: 20 - - name: install dependencies - run: make deps-frontend - - name: lint markdown - run: make lint-md diff --git a/.github/workflows/pull-db-tests.yml b/.github/workflows/pull-db-tests.yml new file mode 100644 index 0000000000..4011b4201b --- /dev/null +++ b/.github/workflows/pull-db-tests.yml @@ -0,0 +1,224 @@ +name: db-tests + +on: [pull_request] + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + test-pgsql: + runs-on: ubuntu-latest + services: + pgsql: + image: postgres:15 + env: + POSTGRES_DB: test + POSTGRES_PASSWORD: postgres + ports: + - "5432:5432" + ldap: + image: gitea/test-openldap:latest + ports: + - "389:389" + - "636:636" + minio: + # as github actions doesn't support "entrypoint", we need to use a non-official image + # that has a custom entrypoint set to "minio server /data" + image: bitnami/minio:2021.3.17 + env: + MINIO_ACCESS_KEY: 123456 + MINIO_SECRET_KEY: 12345678 + ports: + - "9000:9000" + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-go@v4 + with: + go-version: ">=1.20.0" + - name: Add hosts to /etc/hosts + run: echo "127.0.0.1 pgsql ldap minio" | sudo tee -a /etc/hosts + - run: make deps-backend + - run: make backend + env: + TAGS: bindata + - run: make test-pgsql-migration test-pgsql + timeout-minutes: 50 + env: + TAGS: bindata gogit + RACE_ENABLED: true + TEST_TAGS: gogit + TEST_LDAP: 1 + USE_REPO_TEST_DIR: 1 + + test-sqlite: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-go@v4 + with: + go-version: ">=1.20.0" + - run: make deps-backend + - run: make backend + env: + TAGS: bindata gogit sqlite sqlite_unlock_notify + - run: make test-sqlite-migration test-sqlite + timeout-minutes: 50 + env: + TAGS: bindata gogit sqlite sqlite_unlock_notify + RACE_ENABLED: true + TEST_TAGS: gogit sqlite sqlite_unlock_notify + USE_REPO_TEST_DIR: 1 + + test-unit: + runs-on: ubuntu-latest + services: + mysql: + image: mysql:5.7 + env: + MYSQL_ALLOW_EMPTY_PASSWORD: yes + MYSQL_DATABASE: test + ports: + - "3306:3306" + elasticsearch: + image: elasticsearch:7.5.0 + env: + discovery.type: single-node + ports: + - "9200:9200" + smtpimap: + image: tabascoterrier/docker-imap-devel:latest + ports: + - "25:25" + - "143:143" + - "587:587" + - "993:993" + redis: + image: redis + options: >- # wait until redis has started + --health-cmd "redis-cli ping" + --health-interval 5s + --health-timeout 3s + --health-retries 10 + ports: + - 6379:6379 + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-go@v4 + with: + go-version: ">=1.20.0" + - name: Add hosts to /etc/hosts + run: echo "127.0.0.1 mysql elasticsearch smtpimap" | sudo tee -a /etc/hosts + - run: make deps-backend + - run: make backend + env: + TAGS: bindata + - name: unit-tests + run: make unit-test-coverage test-check + env: + TAGS: bindata + RACE_ENABLED: true + GITHUB_READ_TOKEN: ${{ secrets.GITHUB_READ_TOKEN }} + - name: unit-tests-gogit + run: make unit-test-coverage test-check + env: + TAGS: bindata gogit + RACE_ENABLED: true + GITHUB_READ_TOKEN: ${{ secrets.GITHUB_READ_TOKEN }} + + test-mysql5: + runs-on: ubuntu-latest + services: + mysql: + image: mysql:5.7 + env: + MYSQL_ALLOW_EMPTY_PASSWORD: yes + MYSQL_DATABASE: test + ports: + - "3306:3306" + elasticsearch: + image: elasticsearch:7.5.0 + env: + discovery.type: single-node + ports: + - "9200:9200" + smtpimap: + image: tabascoterrier/docker-imap-devel:latest + ports: + - "25:25" + - "143:143" + - "587:587" + - "993:993" + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-go@v4 + with: + go-version: ">=1.20.0" + - name: Add hosts to /etc/hosts + run: echo "127.0.0.1 mysql elasticsearch smtpimap" | sudo tee -a /etc/hosts + - run: make deps-backend + - run: make backend + env: + TAGS: bindata + - name: run tests + run: make test-mysql-migration integration-test-coverage + env: + TAGS: bindata + RACE_ENABLED: true + USE_REPO_TEST_DIR: 1 + TEST_INDEXER_CODE_ES_URL: "http://elastic:changeme@elasticsearch:9200" + + test-mysql8: + runs-on: ubuntu-latest + services: + mysql8: + image: mysql:8 + env: + MYSQL_ALLOW_EMPTY_PASSWORD: yes + MYSQL_DATABASE: testgitea + ports: + - "3306:3306" + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-go@v4 + with: + go-version: ">=1.20.0" + - name: Add hosts to /etc/hosts + run: echo "127.0.0.1 mysql8" | sudo tee -a /etc/hosts + - run: make deps-backend + - run: make backend + env: + TAGS: bindata + - run: make test-mysql8-migration test-mysql8 + timeout-minutes: 50 + env: + TAGS: bindata + USE_REPO_TEST_DIR: 1 + + test-mssql: + runs-on: ubuntu-latest + services: + mssql: + image: mcr.microsoft.com/mssql/server:latest + env: + ACCEPT_EULA: Y + MSSQL_PID: Standard + SA_PASSWORD: MwantsaSecurePassword1 + ports: + - "1433:1433" + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-go@v4 + with: + go-version: ">=1.20.0" + - name: Add hosts to /etc/hosts + run: echo "127.0.0.1 mssql" | sudo tee -a /etc/hosts + - run: make deps-backend + - run: make backend + env: + TAGS: bindata + - run: make test-mssql-migration test-mssql + timeout-minutes: 50 + env: + TAGS: bindata + USE_REPO_TEST_DIR: 1 diff --git a/.github/workflows/pull-db_test.yml b/.github/workflows/pull-db_test.yml deleted file mode 100644 index 243499b611..0000000000 --- a/.github/workflows/pull-db_test.yml +++ /dev/null @@ -1,274 +0,0 @@ -name: "Pull: Database Tests" - -on: [pull_request] - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - # PostgreSQL Tests - db_pgsql_test: - runs-on: ubuntu-latest - services: - pgsql: - image: postgres:15 - env: - POSTGRES_DB: test - POSTGRES_PASSWORD: postgres - ports: - - "5432:5432" - ldap: - image: gitea/test-openldap:latest - ports: - - "389:389" - - "636:636" - minio: - # as github actions doesn't support "entrypoint", we need to use a non-official image - # that has a custom entrypoint set to "minio server /data" - image: bitnami/minio:2021.3.17 - env: - MINIO_ACCESS_KEY: 123456 - MINIO_SECRET_KEY: 12345678 - ports: - - "9000:9000" - steps: - - name: checkout - uses: actions/checkout@v3 - - name: setup go - uses: actions/setup-go@v4 - with: - go-version: '>=1.20.0' - - name: Add hosts to /etc/hosts - run: echo "127.0.0.1 pgsql ldap minio" | sudo tee -a /etc/hosts - - name: install dependencies - run: make deps-backend - - name: build - run: make backend - env: - GOPROXY: https://goproxy.io - GOSUMDB: sum.golang.org - TAGS: bindata - - name: run tests - run: timeout -s ABRT 50m make test-pgsql-migration test-pgsql - env: - GOPROXY: https://goproxy.io - TAGS: bindata gogit - RACE_ENABLED: true - TEST_TAGS: gogit - TEST_LDAP: 1 - USE_REPO_TEST_DIR: 1 - - # SQLite Tests - db_sqlite_test: - runs-on: ubuntu-latest - steps: - - name: checkout - uses: actions/checkout@v3 - - name: setup go - uses: actions/setup-go@v4 - with: - go-version: '>=1.20.0' - - name: install dependencies - run: make deps-backend - - name: build - run: make backend - env: - GOPROXY: https://goproxy.io - GOSUMDB: sum.golang.org - TAGS: bindata gogit sqlite sqlite_unlock_notify - - name: run tests - run: timeout -s ABRT 50m make test-sqlite-migration test-sqlite - env: - GOPROXY: https://goproxy.io - TAGS: bindata gogit sqlite sqlite_unlock_notify - RACE_ENABLED: true - TEST_TAGS: gogit sqlite sqlite_unlock_notify - USE_REPO_TEST_DIR: 1 - - # Unit Tests - db_unit_tests: - runs-on: ubuntu-latest - services: - mysql: - image: mysql:5.7 - env: - MYSQL_ALLOW_EMPTY_PASSWORD: yes - MYSQL_DATABASE: test - ports: - - "3306:3306" - elasticsearch: - image: elasticsearch:7.5.0 - env: - discovery.type: single-node - ports: - - "9200:9200" - smtpimap: - image: tabascoterrier/docker-imap-devel:latest - ports: - - "25:25" - - "143:143" - - "587:587" - - "993:993" - redis: - image: redis - # Set health checks to wait until redis has started - options: >- - --health-cmd "redis-cli ping" - --health-interval 5s - --health-timeout 3s - --health-retries 10 - ports: - - 6379:6379 - steps: - - name: checkout - uses: actions/checkout@v3 - - name: setup go - uses: actions/setup-go@v4 - with: - go-version: '>=1.20.0' - - name: Add hosts to /etc/hosts - run: echo "127.0.0.1 mysql elasticsearch smtpimap" | sudo tee -a /etc/hosts - - name: install dependencies - run: make deps-backend - - name: build - run: make backend - env: - GOPROXY: https://goproxy.io - GOSUMDB: sum.golang.org - TAGS: bindata - - name: unit tests - run: make unit-test-coverage test-check - env: - GOPROXY: https://goproxy.io - TAGS: bindata - RACE_ENABLED: true - GITHUB_READ_TOKEN: ${{ secrets.GITHUB_READ_TOKEN }} - - name: unit tests (gogit) - run: make unit-test-coverage test-check - env: - GOPROXY: https://goproxy.io - TAGS: bindata gogit - RACE_ENABLED: true - GITHUB_READ_TOKEN: ${{ secrets.GITHUB_READ_TOKEN }} - - # MySQL Tests - db_mysql_test: - runs-on: ubuntu-latest - services: - mysql: - image: mysql:5.7 - env: - MYSQL_ALLOW_EMPTY_PASSWORD: yes - MYSQL_DATABASE: test - ports: - - "3306:3306" - elasticsearch: - image: elasticsearch:7.5.0 - env: - discovery.type: single-node - ports: - - "9200:9200" - smtpimap: - image: tabascoterrier/docker-imap-devel:latest - ports: - - "25:25" - - "143:143" - - "587:587" - - "993:993" - steps: - - name: checkout - uses: actions/checkout@v3 - - name: setup go - uses: actions/setup-go@v4 - with: - go-version: '>=1.20.0' - - name: Add hosts to /etc/hosts - run: echo "127.0.0.1 mysql elasticsearch smtpimap" | sudo tee -a /etc/hosts - - name: install dependencies - run: make deps-backend - - name: build - run: make backend - env: - GOPROXY: https://goproxy.io - GOSUMDB: sum.golang.org - TAGS: bindata - - name: run tests - run: make test-mysql-migration integration-test-coverage - env: - GOPROXY: https://goproxy.io - TAGS: bindata - RACE_ENABLED: true - USE_REPO_TEST_DIR: 1 - TEST_INDEXER_CODE_ES_URL: "http://elastic:changeme@elasticsearch:9200" - - # MySQL8 Tests - db_mysql8_test: - runs-on: ubuntu-latest - services: - mysql8: - image: mysql:8 - env: - MYSQL_ALLOW_EMPTY_PASSWORD: yes - MYSQL_DATABASE: testgitea - ports: - - "3306:3306" - steps: - - name: checkout - uses: actions/checkout@v3 - - name: setup go - uses: actions/setup-go@v4 - with: - go-version: '>=1.20.0' - - name: Add hosts to /etc/hosts - run: echo "127.0.0.1 mysql8" | sudo tee -a /etc/hosts - - name: install dependencies - run: make deps-backend - - name: build - run: make backend - env: - GOPROXY: https://goproxy.io - GOSUMDB: sum.golang.org - TAGS: bindata - - name: run tests - run: timeout -s ABRT 50m make test-mysql8-migration test-mysql8 - env: - GOPROXY: https://goproxy.io - TAGS: bindata - USE_REPO_TEST_DIR: 1 - - # MSSQL Tests - db_mssql_test: - runs-on: ubuntu-latest - services: - mssql: - image: mcr.microsoft.com/mssql/server:latest - env: - ACCEPT_EULA: Y - MSSQL_PID: Standard - SA_PASSWORD: MwantsaSecurePassword1 - ports: - - "1433:1433" - steps: - - name: checkout - uses: actions/checkout@v3 - - name: setup go - uses: actions/setup-go@v4 - with: - go-version: '>=1.20.0' - - name: Add hosts to /etc/hosts - run: echo "127.0.0.1 mssql" | sudo tee -a /etc/hosts - - name: install dependencies - run: make deps-backend - - name: build - run: make backend - env: - GOPROXY: https://goproxy.io - GOSUMDB: sum.golang.org - TAGS: bindata - - name: run tests - run: timeout -s ABRT 50m make test-mssql-migration test-mssql - env: - GOPROXY: https://goproxy.io - TAGS: bindata - USE_REPO_TEST_DIR: 1 diff --git a/.github/workflows/pull-docker-dryrun.yml b/.github/workflows/pull-docker-dryrun.yml new file mode 100644 index 0000000000..3d2207940f --- /dev/null +++ b/.github/workflows/pull-docker-dryrun.yml @@ -0,0 +1,17 @@ +name: docker-dryrun + +on: [pull_request] + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + docker-dryrun: + runs-on: ubuntu-latest + steps: + - uses: docker/setup-buildx-action@v2 + - uses: docker/build-push-action@v4 + with: + push: false + tags: gitea/gitea:linux-amd64 diff --git a/.github/workflows/pull-docker_dryrun.yml b/.github/workflows/pull-docker_dryrun.yml deleted file mode 100644 index f17d6014b6..0000000000 --- a/.github/workflows/pull-docker_dryrun.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: "Pull: Docker Dry Run" - -on: [pull_request] - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - docker_dryrun: - runs-on: ubuntu-latest - steps: - - name: checkout - uses: actions/checkout@v3 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - name: Build and push - uses: docker/build-push-action@v4 - with: - push: false - tags: gitea/gitea:linux-amd64 - build-args: | - GOPROXY=https://goproxy.io diff --git a/.github/workflows/pull-e2e-tests.yml b/.github/workflows/pull-e2e-tests.yml new file mode 100644 index 0000000000..a854489e4d --- /dev/null +++ b/.github/workflows/pull-e2e-tests.yml @@ -0,0 +1,26 @@ +name: e2e-tests + +on: [pull_request] + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + test-e2e: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-go@v4 + with: + go-version: ">=1.20" + check-latest: true + - uses: actions/setup-node@v3 + with: + node-version: 20 + - run: make deps-frontend frontend deps-backend + - run: npx playwright install --with-deps + - run: make test-e2e-sqlite + timeout-minutes: 40 + env: + USE_REPO_TEST_DIR: 1 diff --git a/.github/workflows/pull-e2e.yml b/.github/workflows/pull-e2e.yml deleted file mode 100644 index 79c5417508..0000000000 --- a/.github/workflows/pull-e2e.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: "Pull: E2E Tests" - -on: [pull_request] - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - e2e_tests: - runs-on: ubuntu-latest - steps: - - name: checkout - uses: actions/checkout@v3 - - name: setup go - uses: actions/setup-go@v4 - with: - go-version: '>=1.20' - check-latest: true - - name: setup node - uses: actions/setup-node@v3 - with: - node-version: 20 - - name: build - run: make deps-frontend frontend deps-backend - - name: Install playwright browsers - run: npx playwright install --with-deps - - name: run tests - run: timeout -s ABRT 40m make test-e2e-sqlite - env: - GOPROXY: https://goproxy.io - GOSUMDB: sum.golang.org - USE_REPO_TEST_DIR: 1 diff --git a/.github/workflows/push-publish_docs.yml b/.github/workflows/push-publish_docs.yml deleted file mode 100644 index 9037e278ca..0000000000 --- a/.github/workflows/push-publish_docs.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: "Docs: Publish" - -on: - push: - paths: - - "docs/**" - branches: - - main - -jobs: - compliance-docs: - runs-on: ubuntu-latest - steps: - - name: checkout - uses: actions/checkout@v3 - - name: setup go - uses: actions/setup-go@v4 - with: - go-version: '>=1.20.1' - - name: build docs - run: | - cd docs - make trans-copy clean build - - name: publish to netlify - uses: nwtgck/actions-netlify@v2.0 - with: - production-branch: main - publish-dir: docs/public/ - env: - NETLIFY_SITE_ID: d2260bae-7861-4c02-8646-8f6440b12672 - NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} diff --git a/Makefile b/Makefile index 6a03875b79..3d777505a5 100644 --- a/Makefile +++ b/Makefile @@ -394,7 +394,7 @@ lint-go: lint-go-fix: $(GO) run $(GOLANGCI_LINT_PACKAGE) run --fix -# workaround step for the lint-backend-windows CI task because 'go run' can not +# workaround step for the lint-go-windows CI task because 'go run' can not # have distinct GOOS/GOARCH for its build and run steps .PHONY: lint-go-windows lint-go-windows: @@ -409,7 +409,7 @@ lint-go-vet: .PHONY: lint-editorconfig lint-editorconfig: - $(GO) run $(EDITORCONFIG_CHECKER_PACKAGE) templates + $(GO) run $(EDITORCONFIG_CHECKER_PACKAGE) templates .github/workflows .PHONY: watch watch: -- cgit v1.2.3