460 lines
17 KiB
Diff
460 lines
17 KiB
Diff
9d8
|
|
< workflow_dispatch:
|
|
13d11
|
|
< if: vars.ROLE == 'forgejo-coding' || vars.ROLE == 'forgejo-testing'
|
|
16,17c14
|
|
< image: 'data.forgejo.org/oci/node:20-bookworm'
|
|
< options: --tmpfs /tmp:exec,noatime
|
|
---
|
|
> image: 'code.forgejo.org/oci/node:20-bookworm'
|
|
24,28c21,34
|
|
< - uses: https://data.forgejo.org/actions/checkout@v4
|
|
< - uses: ./.forgejo/workflows-composite/setup-env
|
|
< - run: su forgejo -c 'make deps-backend deps-tools'
|
|
< - run: su forgejo -c 'make --always-make -j$(nproc) lint-backend tidy-check swagger-check fmt-check swagger-validate' # ensure the "go-licenses" make target runs
|
|
< - uses: ./.forgejo/workflows-composite/build-backend
|
|
---
|
|
> - uses: https://code.forgejo.org/actions/checkout@v4
|
|
> - uses: https://code.forgejo.org/actions/setup-go@v4
|
|
> with:
|
|
> go-version-file: "go.mod"
|
|
> - run: make deps-backend deps-tools
|
|
> - run: make --always-make -j$(nproc) lint-backend tidy-check swagger-check fmt-check swagger-validate # ensure the "go-licenses" make target runs
|
|
> - run: |
|
|
> make backend
|
|
> env:
|
|
> TAGS: bindata
|
|
> - uses: actions/cache@v4
|
|
> with:
|
|
> path: '/workspace/forgejo/forgejo/gitea'
|
|
> key: backend-build-${{ github.sha }}
|
|
30d35
|
|
< if: vars.ROLE == 'forgejo-coding' || vars.ROLE == 'forgejo-testing'
|
|
33,34c38
|
|
< image: 'data.forgejo.org/oci/node:20-bookworm'
|
|
< options: --tmpfs /tmp:exec,noatime
|
|
---
|
|
> image: 'code.forgejo.org/oci/node:20-bookworm'
|
|
36c40
|
|
< - uses: https://data.forgejo.org/actions/checkout@v4
|
|
---
|
|
> - uses: https://code.forgejo.org/actions/checkout@v4
|
|
42,52d45
|
|
< - name: Install zstd for cache saving
|
|
< # works around https://github.com/actions/cache/issues/1169, because the
|
|
< # consuming job has zstd and doesn't restore the cache otherwise
|
|
< run: |
|
|
< apt-get update -qq
|
|
< apt-get -q install -qq -y zstd
|
|
< - name: "Cache frontend build for playwright testing"
|
|
< uses: actions/cache/save@v4
|
|
< with:
|
|
< path: ${{github.workspace}}/public/assets
|
|
< key: frontend-build-${{ github.sha }}
|
|
54d46
|
|
< if: vars.ROLE == 'forgejo-coding' || vars.ROLE == 'forgejo-testing'
|
|
58,59c50
|
|
< image: 'data.forgejo.org/oci/node:20-bookworm'
|
|
< options: --tmpfs /tmp:exec,noatime
|
|
---
|
|
> image: 'code.forgejo.org/oci/node:20-bookworm'
|
|
62,63c53
|
|
< image: data.forgejo.org/oci/bitnami/elasticsearch:7
|
|
< options: --tmpfs /bitnami/elasticsearch/data
|
|
---
|
|
> image: docker.io/bitnami/elasticsearch:7
|
|
68c58
|
|
< image: data.forgejo.org/oci/bitnami/minio:2024.8.17
|
|
---
|
|
> image: docker.io/bitnami/minio:2024.8.17
|
|
70c60
|
|
< --hostname gitea.minio --tmpfs /bitnami/minio/data:noatime
|
|
---
|
|
> --hostname gitea.minio
|
|
76,79c66,67
|
|
< - uses: https://data.forgejo.org/actions/checkout@v4
|
|
< - uses: ./.forgejo/workflows-composite/setup-env
|
|
< - name: install git >= 2.42
|
|
< uses: ./.forgejo/workflows-composite/apt-install-from
|
|
---
|
|
> - uses: https://code.forgejo.org/actions/checkout@v4
|
|
> - uses: https://code.forgejo.org/actions/setup-go@v4
|
|
81c69,81
|
|
< packages: git
|
|
---
|
|
> go-version-file: "go.mod"
|
|
> - run: |
|
|
> git config --add safe.directory '*'
|
|
> adduser --quiet --comment forgejo --disabled-password forgejo
|
|
> chown -R forgejo:forgejo .
|
|
> - name: install git >= 2.42
|
|
> run: |
|
|
> export DEBIAN_FRONTEND=noninteractive
|
|
> echo deb http://deb.debian.org/debian/ testing main > /etc/apt/sources.list.d/testing.list
|
|
> apt-get update -qq
|
|
> apt-get -q install -qq -y git
|
|
> rm /etc/apt/sources.list.d/testing.list
|
|
> apt-get update -qq
|
|
86c86,97
|
|
< - uses: ./.forgejo/workflows-composite/build-backend
|
|
---
|
|
> - run: |
|
|
> su forgejo -c 'make deps-backend'
|
|
> - uses: actions/cache/restore@v4
|
|
> id: cache-backend
|
|
> with:
|
|
> path: '/workspace/forgejo/forgejo/gitea'
|
|
> key: backend-build-${{ github.sha }}
|
|
> - if: steps.cache-backend.outputs.cache-hit != 'true'
|
|
> run: |
|
|
> su forgejo -c 'make backend'
|
|
> env:
|
|
> TAGS: bindata
|
|
89c100
|
|
< timeout-minutes: 120
|
|
---
|
|
> timeout-minutes: 50
|
|
94,135d104
|
|
< test-e2e:
|
|
< if: vars.ROLE == 'forgejo-coding' || vars.ROLE == 'forgejo-testing'
|
|
< runs-on: docker
|
|
< needs: [backend-checks, frontend-checks]
|
|
< container:
|
|
< image: 'data.forgejo.org/oci/playwright:latest'
|
|
< options: --tmpfs /tmp:exec,noatime
|
|
< steps:
|
|
< - uses: https://data.forgejo.org/actions/checkout@v4
|
|
< with:
|
|
< fetch-depth: 20
|
|
< - uses: ./.forgejo/workflows-composite/setup-env
|
|
< - name: "Restore frontend build"
|
|
< uses: actions/cache/restore@v4
|
|
< id: cache-frontend
|
|
< with:
|
|
< path: ${{github.workspace}}/public/assets
|
|
< key: frontend-build-${{ github.sha }}
|
|
< - name: "Build frontend (if not cached)"
|
|
< if: steps.cache-frontend.outputs.cache-hit != 'true'
|
|
< run: |
|
|
< su forgejo -c 'make deps-frontend frontend'
|
|
< - uses: ./.forgejo/workflows-composite/build-backend
|
|
< - name: Get changed files
|
|
< id: changed-files
|
|
< uses: https://data.forgejo.org/tj-actions/changed-files@v45
|
|
< with:
|
|
< separator: '\n'
|
|
< - run: |
|
|
< su forgejo -c 'make generate test-e2e-sqlite'
|
|
< timeout-minutes: 120
|
|
< env:
|
|
< USE_REPO_TEST_DIR: 1
|
|
< PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
|
|
< CHANGED_FILES: ${{steps.changed-files.outputs.all_changed_files}}
|
|
< - name: Upload test artifacts on failure
|
|
< if: failure()
|
|
< uses: https://data.forgejo.org/forgejo/upload-artifact@v4
|
|
< with:
|
|
< name: test-artifacts.zip
|
|
< path: tests/e2e/test-artifacts/
|
|
< retention-days: 3
|
|
137d105
|
|
< if: vars.ROLE == 'forgejo-coding' || vars.ROLE == 'forgejo-testing'
|
|
139c107
|
|
< needs: [backend-checks, frontend-checks, test-unit]
|
|
---
|
|
> needs: [backend-checks, frontend-checks]
|
|
141,143c109
|
|
< image: 'data.forgejo.org/oci/node:20-bookworm'
|
|
< options: --tmpfs /tmp:exec,noatime
|
|
< name: ${{ format('test-remote-cacher ({0})', matrix.cacher.name) }}
|
|
---
|
|
> image: 'code.forgejo.org/oci/node:20-bookworm'
|
|
147,158c113,124
|
|
< - name: redis
|
|
< image: data.forgejo.org/oci/bitnami/redis:7.2
|
|
< options: --tmpfs /bitnami/redis/data:noatime
|
|
< - name: redict
|
|
< image: registry.redict.io/redict:7.3.0-scratch
|
|
< options: --tmpfs /data:noatime
|
|
< - name: valkey
|
|
< image: data.forgejo.org/oci/bitnami/valkey:7.2
|
|
< options: --tmpfs /bitnami/redis/data:noatime
|
|
< - name: garnet
|
|
< image: ghcr.io/microsoft/garnet-alpine:1.0.14
|
|
< options: --tmpfs /data:noatime
|
|
---
|
|
> # redis
|
|
> - image: docker.io/bitnami/redis:7.2
|
|
> port: 6379
|
|
> # redict
|
|
> - image: registry.redict.io/redict:7.3.0-scratch
|
|
> port: 6379
|
|
> # valkey
|
|
> - image: docker.io/bitnami/valkey:7.2
|
|
> port: 6379
|
|
> # garnet
|
|
> - image: ghcr.io/microsoft/garnet-alpine:1.0.14
|
|
> port: 6379
|
|
164,165c130,137
|
|
< - uses: https://data.forgejo.org/actions/checkout@v4
|
|
< - uses: ./.forgejo/workflows-composite/setup-env
|
|
---
|
|
> - uses: https://code.forgejo.org/actions/checkout@v4
|
|
> - uses: https://code.forgejo.org/actions/setup-go@v4
|
|
> with:
|
|
> go-version-file: "go.mod"
|
|
> - run: |
|
|
> git config --add safe.directory '*'
|
|
> adduser --quiet --comment forgejo --disabled-password forgejo
|
|
> chown -R forgejo:forgejo .
|
|
167c139,149
|
|
< uses: ./.forgejo/workflows-composite/apt-install-from
|
|
---
|
|
> run: |
|
|
> export DEBIAN_FRONTEND=noninteractive
|
|
> echo deb http://deb.debian.org/debian/ testing main > /etc/apt/sources.list.d/testing.list
|
|
> apt-get update -qq
|
|
> apt-get -q install -qq -y git
|
|
> rm /etc/apt/sources.list.d/testing.list
|
|
> apt-get update -qq
|
|
> - run: |
|
|
> su forgejo -c 'make deps-backend'
|
|
> - uses: actions/cache/restore@v4
|
|
> id: cache-backend
|
|
169,170c151,157
|
|
< packages: git
|
|
< - uses: ./.forgejo/workflows-composite/build-backend
|
|
---
|
|
> path: '/workspace/forgejo/forgejo/gitea'
|
|
> key: backend-build-${{ github.sha }}
|
|
> - if: steps.cache-backend.outputs.cache-hit != 'true'
|
|
> run: |
|
|
> su forgejo -c 'make backend'
|
|
> env:
|
|
> TAGS: bindata
|
|
173c160
|
|
< timeout-minutes: 120
|
|
---
|
|
> timeout-minutes: 50
|
|
179d165
|
|
< if: vars.ROLE == 'forgejo-coding' || vars.ROLE == 'forgejo-testing'
|
|
183,184c169
|
|
< image: 'data.forgejo.org/oci/node:20-bookworm'
|
|
< options: --tmpfs /tmp:exec,noatime
|
|
---
|
|
> image: 'code.forgejo.org/oci/node:20-bookworm'
|
|
187c172
|
|
< image: 'data.forgejo.org/oci/bitnami/mysql:8.4'
|
|
---
|
|
> image: 'docker.io/bitnami/mysql:8.4'
|
|
194,195c179
|
|
< MYSQL_EXTRA_FLAGS: --innodb-adaptive-flushing=OFF --innodb-buffer-pool-size=4G --innodb-log-buffer-size=128M --innodb-flush-log-at-trx-commit=0 --innodb-flush-log-at-timeout=30 --innodb-flush-method=nosync --innodb-fsync-threshold=1000000000 --disable-log-bin
|
|
< options: --tmpfs /bitnami/mysql/data:noatime
|
|
---
|
|
> MYSQL_EXTRA_FLAGS: --innodb-adaptive-flushing=OFF --innodb-buffer-pool-size=4G --innodb-log-buffer-size=128M --innodb-flush-log-at-trx-commit=0 --innodb-flush-log-at-timeout=30 --innodb-flush-method=nosync --innodb-fsync-threshold=1000000000
|
|
197,198c181,184
|
|
< - uses: https://data.forgejo.org/actions/checkout@v4
|
|
< - uses: ./.forgejo/workflows-composite/setup-env
|
|
---
|
|
> - uses: https://code.forgejo.org/actions/checkout@v4
|
|
> - uses: https://code.forgejo.org/actions/setup-go@v4
|
|
> with:
|
|
> go-version-file: "go.mod"
|
|
200c186,211
|
|
< uses: ./.forgejo/workflows-composite/apt-install-from
|
|
---
|
|
> run: |
|
|
> export DEBIAN_FRONTEND=noninteractive
|
|
> echo deb http://deb.debian.org/debian/ testing main > /etc/apt/sources.list.d/testing.list
|
|
> apt-get update -qq
|
|
> apt-get install --no-install-recommends -qq -y git git-lfs
|
|
> rm /etc/apt/sources.list.d/testing.list
|
|
> apt-get update -qq
|
|
> cd /
|
|
> wget https://downloads.kitenet.net/git-annex/linux/current/git-annex-standalone-amd64.tar.gz
|
|
> tar xzvf git-annex-standalone-amd64.tar.gz
|
|
> ln -s \
|
|
> /git-annex.linux/git-annex \
|
|
> /git-annex.linux/git-annex-shell \
|
|
> /git-annex.linux/git-annex-webapp \
|
|
> /git-annex.linux/git-remote-annex \
|
|
> bin
|
|
> cd -
|
|
> - name: setup user and permissions
|
|
> run: |
|
|
> git config --add safe.directory '*'
|
|
> adduser --quiet --comment forgejo --disabled-password forgejo
|
|
> chown -R forgejo:forgejo .
|
|
> - run: |
|
|
> su forgejo -c 'make deps-backend'
|
|
> - uses: actions/cache/restore@v4
|
|
> id: cache-backend
|
|
202,203c213,219
|
|
< packages: git git-lfs
|
|
< - uses: ./.forgejo/workflows-composite/build-backend
|
|
---
|
|
> path: '/workspace/forgejo/forgejo/gitea'
|
|
> key: backend-build-${{ github.sha }}
|
|
> - if: steps.cache-backend.outputs.cache-hit != 'true'
|
|
> run: |
|
|
> su forgejo -c 'make backend'
|
|
> env:
|
|
> TAGS: bindata
|
|
206d221
|
|
< timeout-minutes: 120
|
|
210d224
|
|
< if: vars.ROLE == 'forgejo-coding' || vars.ROLE == 'forgejo-testing'
|
|
214,215c228
|
|
< image: 'data.forgejo.org/oci/node:20-bookworm'
|
|
< options: --tmpfs /tmp:exec,noatime
|
|
---
|
|
> image: 'code.forgejo.org/oci/node:20-bookworm'
|
|
218c231
|
|
< image: data.forgejo.org/oci/bitnami/minio:2024.8.17
|
|
---
|
|
> image: docker.io/bitnami/minio:2024.8.17
|
|
222d234
|
|
< options: --tmpfs /bitnami/minio/data
|
|
224c236
|
|
< image: data.forgejo.org/oci/test-openldap:latest
|
|
---
|
|
> image: docker.io/gitea/test-openldap:latest
|
|
226c238
|
|
< image: data.forgejo.org/oci/bitnami/postgresql:15
|
|
---
|
|
> image: 'code.forgejo.org/oci/postgres:15'
|
|
228,232c240,241
|
|
< POSTGRESQL_DATABASE: test
|
|
< POSTGRESQL_PASSWORD: postgres
|
|
< POSTGRESQL_FSYNC: off
|
|
< POSTGRESQL_EXTRA_FLAGS: -c full_page_writes=off
|
|
< options: --tmpfs /bitnami/postgresql
|
|
---
|
|
> POSTGRES_DB: test
|
|
> POSTGRES_PASSWORD: postgres
|
|
234,235c243,246
|
|
< - uses: https://data.forgejo.org/actions/checkout@v4
|
|
< - uses: ./.forgejo/workflows-composite/setup-env
|
|
---
|
|
> - uses: https://code.forgejo.org/actions/checkout@v4
|
|
> - uses: https://code.forgejo.org/actions/setup-go@v4
|
|
> with:
|
|
> go-version-file: "go.mod"
|
|
237c248,273
|
|
< uses: ./.forgejo/workflows-composite/apt-install-from
|
|
---
|
|
> run: |
|
|
> export DEBIAN_FRONTEND=noninteractive
|
|
> echo deb http://deb.debian.org/debian/ testing main > /etc/apt/sources.list.d/testing.list
|
|
> apt-get update -qq
|
|
> apt-get install --no-install-recommends -qq -y git git-lfs
|
|
> rm /etc/apt/sources.list.d/testing.list
|
|
> apt-get update -qq
|
|
> cd /
|
|
> wget https://downloads.kitenet.net/git-annex/linux/current/git-annex-standalone-amd64.tar.gz
|
|
> tar xzvf git-annex-standalone-amd64.tar.gz
|
|
> ln -s \
|
|
> /git-annex.linux/git-annex \
|
|
> /git-annex.linux/git-annex-shell \
|
|
> /git-annex.linux/git-annex-webapp \
|
|
> /git-annex.linux/git-remote-annex \
|
|
> bin
|
|
> cd -
|
|
> - name: setup user and permissions
|
|
> run: |
|
|
> git config --add safe.directory '*'
|
|
> adduser --quiet --comment forgejo --disabled-password forgejo
|
|
> chown -R forgejo:forgejo .
|
|
> - run: |
|
|
> su forgejo -c 'make deps-backend'
|
|
> - uses: actions/cache/restore@v4
|
|
> id: cache-backend
|
|
239,240c275,281
|
|
< packages: git git-lfs
|
|
< - uses: ./.forgejo/workflows-composite/build-backend
|
|
---
|
|
> path: '/workspace/forgejo/forgejo/gitea'
|
|
> key: backend-build-${{ github.sha }}
|
|
> - if: steps.cache-backend.outputs.cache-hit != 'true'
|
|
> run: |
|
|
> su forgejo -c 'make backend'
|
|
> env:
|
|
> TAGS: bindata
|
|
243d283
|
|
< timeout-minutes: 120
|
|
249d288
|
|
< if: vars.ROLE == 'forgejo-coding' || vars.ROLE == 'forgejo-testing'
|
|
253,254c292
|
|
< image: 'data.forgejo.org/oci/node:20-bookworm'
|
|
< options: --tmpfs /tmp:exec,noatime
|
|
---
|
|
> image: 'code.forgejo.org/oci/node:20-bookworm'
|
|
256,257c294,297
|
|
< - uses: https://data.forgejo.org/actions/checkout@v4
|
|
< - uses: ./.forgejo/workflows-composite/setup-env
|
|
---
|
|
> - uses: https://code.forgejo.org/actions/checkout@v4
|
|
> - uses: https://code.forgejo.org/actions/setup-go@v4
|
|
> with:
|
|
> go-version-file: "go.mod"
|
|
259c299,324
|
|
< uses: ./.forgejo/workflows-composite/apt-install-from
|
|
---
|
|
> run: |
|
|
> export DEBIAN_FRONTEND=noninteractive
|
|
> echo deb http://deb.debian.org/debian/ testing main > /etc/apt/sources.list.d/testing.list
|
|
> apt-get update -qq
|
|
> apt-get install --no-install-recommends -qq -y git git-lfs
|
|
> rm /etc/apt/sources.list.d/testing.list
|
|
> apt-get update -qq
|
|
> cd /
|
|
> wget https://downloads.kitenet.net/git-annex/linux/current/git-annex-standalone-amd64.tar.gz
|
|
> tar xzvf git-annex-standalone-amd64.tar.gz
|
|
> ln -s \
|
|
> /git-annex.linux/git-annex \
|
|
> /git-annex.linux/git-annex-shell \
|
|
> /git-annex.linux/git-annex-webapp \
|
|
> /git-annex.linux/git-remote-annex \
|
|
> bin
|
|
> cd -
|
|
> - name: setup user and permissions
|
|
> run: |
|
|
> git config --add safe.directory '*'
|
|
> adduser --quiet --comment forgejo --disabled-password forgejo
|
|
> chown -R forgejo:forgejo .
|
|
> - run: |
|
|
> su forgejo -c 'make deps-backend'
|
|
> - uses: actions/cache/restore@v4
|
|
> id: cache-backend
|
|
261,262c326,332
|
|
< packages: git git-lfs
|
|
< - uses: ./.forgejo/workflows-composite/build-backend
|
|
---
|
|
> path: '/workspace/forgejo/forgejo/gitea'
|
|
> key: backend-build-${{ github.sha }}
|
|
> - if: steps.cache-backend.outputs.cache-hit != 'true'
|
|
> run: |
|
|
> su forgejo -c 'make backend'
|
|
> env:
|
|
> TAGS: bindata sqlite sqlite_unlock_notify
|
|
265d334
|
|
< timeout-minutes: 120
|
|
272d340
|
|
< if: vars.ROLE == 'forgejo-coding' || vars.ROLE == 'forgejo-testing'
|
|
281,282c349
|
|
< image: 'data.forgejo.org/oci/node:20-bookworm'
|
|
< options: --tmpfs /tmp:exec,noatime
|
|
---
|
|
> image: 'code.forgejo.org/oci/node:20-bookworm'
|
|
284,287c351,356
|
|
< - uses: https://data.forgejo.org/actions/checkout@v4
|
|
< - uses: ./.forgejo/workflows-composite/setup-env
|
|
< - run: su forgejo -c 'make deps-backend deps-tools'
|
|
< - run: su forgejo -c 'make security-check'
|
|
---
|
|
> - uses: https://code.forgejo.org/actions/checkout@v4
|
|
> - uses: https://code.forgejo.org/actions/setup-go@v4
|
|
> with:
|
|
> go-version-file: "go.mod"
|
|
> - run: make deps-backend deps-tools
|
|
> - run: make security-check
|