mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-27 14:13:52 +03:00
[CI] Forgejo Actions based CI for PR & branches (squash) use node:20-bookworm
No longer use the custom test-env image, it is unecessary technical
debt.
Also upgrade to bitnami/minio:2023.8.31 to align with what Gitea tests
(cherry picked from commit d9b77fd273
)
This commit is contained in:
parent
5449933efa
commit
ef8f099f9e
1 changed files with 54 additions and 28 deletions
|
@ -10,6 +10,8 @@ on:
|
||||||
jobs:
|
jobs:
|
||||||
lint-backend:
|
lint-backend:
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
|
container:
|
||||||
|
image: 'docker.io/node:20-bookworm'
|
||||||
steps:
|
steps:
|
||||||
- uses: https://code.forgejo.org/actions/checkout@v3
|
- uses: https://code.forgejo.org/actions/checkout@v3
|
||||||
- uses: https://code.forgejo.org/actions/setup-go@v4
|
- uses: https://code.forgejo.org/actions/setup-go@v4
|
||||||
|
@ -22,6 +24,8 @@ jobs:
|
||||||
TAGS: bindata sqlite sqlite_unlock_notify
|
TAGS: bindata sqlite sqlite_unlock_notify
|
||||||
checks-backend:
|
checks-backend:
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
|
container:
|
||||||
|
image: 'docker.io/node:20-bookworm'
|
||||||
steps:
|
steps:
|
||||||
- uses: https://code.forgejo.org/actions/checkout@v3
|
- uses: https://code.forgejo.org/actions/checkout@v3
|
||||||
- uses: https://code.forgejo.org/actions/setup-go@v4
|
- uses: https://code.forgejo.org/actions/setup-go@v4
|
||||||
|
@ -34,13 +38,13 @@ jobs:
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
needs: [lint-backend, checks-backend]
|
needs: [lint-backend, checks-backend]
|
||||||
container:
|
container:
|
||||||
image: codeberg.org/forgejo/test_env:main
|
image: 'docker.io/node:20-bookworm'
|
||||||
services:
|
services:
|
||||||
minio:
|
minio:
|
||||||
image: bitnami/minio:2021.3.17
|
image: 'docker.io/bitnami/minio:2023.8.31'
|
||||||
env:
|
env:
|
||||||
MINIO_ACCESS_KEY: 123456
|
MINIO_ROOT_USER: 123456
|
||||||
MINIO_SECRET_KEY: 12345678
|
MINIO_ROOT_PASSWORD: 12345678
|
||||||
steps:
|
steps:
|
||||||
- uses: https://code.forgejo.org/actions/checkout@v3
|
- uses: https://code.forgejo.org/actions/checkout@v3
|
||||||
- uses: https://code.forgejo.org/actions/setup-go@v4
|
- uses: https://code.forgejo.org/actions/setup-go@v4
|
||||||
|
@ -48,15 +52,16 @@ jobs:
|
||||||
go-version: "1.21"
|
go-version: "1.21"
|
||||||
- run: |
|
- run: |
|
||||||
git config --add safe.directory '*'
|
git config --add safe.directory '*'
|
||||||
chown -R gitea:gitea . /go
|
adduser --quiet --comment forgejo --disabled-password forgejo
|
||||||
|
chown -R forgejo:forgejo .
|
||||||
- run: |
|
- run: |
|
||||||
su gitea -c 'make deps-backend'
|
su forgejo -c 'make deps-backend'
|
||||||
- run: |
|
- run: |
|
||||||
su gitea -c 'make backend'
|
su forgejo -c 'make backend'
|
||||||
env:
|
env:
|
||||||
TAGS: bindata
|
TAGS: bindata
|
||||||
- run: |
|
- run: |
|
||||||
su gitea -c 'make unit-test-coverage test-check'
|
su forgejo -c 'make unit-test-coverage test-check'
|
||||||
timeout-minutes: 50
|
timeout-minutes: 50
|
||||||
env:
|
env:
|
||||||
RACE_ENABLED: 'true'
|
RACE_ENABLED: 'true'
|
||||||
|
@ -65,10 +70,10 @@ jobs:
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
needs: [lint-backend, checks-backend]
|
needs: [lint-backend, checks-backend]
|
||||||
container:
|
container:
|
||||||
image: codeberg.org/forgejo/test_env:main
|
image: 'docker.io/node:20-bookworm'
|
||||||
services:
|
services:
|
||||||
mysql:
|
mysql:
|
||||||
image: mysql:8-debian
|
image: 'docker.io/mysql:8-debian'
|
||||||
env:
|
env:
|
||||||
MYSQL_ALLOW_EMPTY_PASSWORD: yes
|
MYSQL_ALLOW_EMPTY_PASSWORD: yes
|
||||||
MYSQL_DATABASE: testgitea
|
MYSQL_DATABASE: testgitea
|
||||||
|
@ -81,17 +86,24 @@ jobs:
|
||||||
- uses: https://code.forgejo.org/actions/setup-go@v4
|
- uses: https://code.forgejo.org/actions/setup-go@v4
|
||||||
with:
|
with:
|
||||||
go-version: "1.21"
|
go-version: "1.21"
|
||||||
- run: |
|
- name: install dependencies
|
||||||
|
run: |
|
||||||
|
export DEBIAN_FRONTEND=noninteractive
|
||||||
|
apt-get update -qq
|
||||||
|
apt-get install --no-install-recommends -qq -y git-lfs
|
||||||
|
- name: setup user and permissions
|
||||||
|
run: |
|
||||||
git config --add safe.directory '*'
|
git config --add safe.directory '*'
|
||||||
chown -R gitea:gitea . /go
|
adduser --quiet --comment forgejo --disabled-password forgejo
|
||||||
|
chown -R forgejo:forgejo .
|
||||||
- run: |
|
- run: |
|
||||||
su gitea -c 'make deps-backend'
|
su forgejo -c 'make deps-backend'
|
||||||
- run: |
|
- run: |
|
||||||
su gitea -c 'make backend'
|
su forgejo -c 'make backend'
|
||||||
env:
|
env:
|
||||||
TAGS: bindata
|
TAGS: bindata
|
||||||
- run: |
|
- run: |
|
||||||
su gitea -c 'make test-mysql-migration test-mysql'
|
su forgejo -c 'make test-mysql-migration test-mysql'
|
||||||
timeout-minutes: 50
|
timeout-minutes: 50
|
||||||
env:
|
env:
|
||||||
TAGS: bindata
|
TAGS: bindata
|
||||||
|
@ -100,7 +112,7 @@ jobs:
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
needs: [lint-backend, checks-backend]
|
needs: [lint-backend, checks-backend]
|
||||||
container:
|
container:
|
||||||
image: codeberg.org/forgejo/test_env:main
|
image: 'docker.io/node:20-bookworm'
|
||||||
services:
|
services:
|
||||||
minio:
|
minio:
|
||||||
image: bitnami/minio:2021.3.17
|
image: bitnami/minio:2021.3.17
|
||||||
|
@ -108,7 +120,7 @@ jobs:
|
||||||
MINIO_ACCESS_KEY: 123456
|
MINIO_ACCESS_KEY: 123456
|
||||||
MINIO_SECRET_KEY: 12345678
|
MINIO_SECRET_KEY: 12345678
|
||||||
pgsql:
|
pgsql:
|
||||||
image: postgres:15
|
image: 'docker.io/postgres:15'
|
||||||
env:
|
env:
|
||||||
POSTGRES_DB: test
|
POSTGRES_DB: test
|
||||||
POSTGRES_PASSWORD: postgres
|
POSTGRES_PASSWORD: postgres
|
||||||
|
@ -117,17 +129,24 @@ jobs:
|
||||||
- uses: https://code.forgejo.org/actions/setup-go@v4
|
- uses: https://code.forgejo.org/actions/setup-go@v4
|
||||||
with:
|
with:
|
||||||
go-version: "1.21"
|
go-version: "1.21"
|
||||||
- run: |
|
- name: install dependencies
|
||||||
|
run: |
|
||||||
|
export DEBIAN_FRONTEND=noninteractive
|
||||||
|
apt-get update -qq
|
||||||
|
apt-get install --no-install-recommends -qq -y git-lfs
|
||||||
|
- name: setup user and permissions
|
||||||
|
run: |
|
||||||
git config --add safe.directory '*'
|
git config --add safe.directory '*'
|
||||||
chown -R gitea:gitea . /go
|
adduser --quiet --comment forgejo --disabled-password forgejo
|
||||||
|
chown -R forgejo:forgejo .
|
||||||
- run: |
|
- run: |
|
||||||
su gitea -c 'make deps-backend'
|
su forgejo -c 'make deps-backend'
|
||||||
- run: |
|
- run: |
|
||||||
su gitea -c 'make backend'
|
su forgejo -c 'make backend'
|
||||||
env:
|
env:
|
||||||
TAGS: bindata
|
TAGS: bindata
|
||||||
- run: |
|
- run: |
|
||||||
su gitea -c 'make test-pgsql-migration test-pgsql'
|
su forgejo -c 'make test-pgsql-migration test-pgsql'
|
||||||
timeout-minutes: 50
|
timeout-minutes: 50
|
||||||
env:
|
env:
|
||||||
TAGS: bindata gogit
|
TAGS: bindata gogit
|
||||||
|
@ -138,23 +157,30 @@ jobs:
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
needs: [lint-backend, checks-backend]
|
needs: [lint-backend, checks-backend]
|
||||||
container:
|
container:
|
||||||
image: codeberg.org/forgejo/test_env:main
|
image: 'docker.io/node:20-bookworm'
|
||||||
steps:
|
steps:
|
||||||
- uses: https://code.forgejo.org/actions/checkout@v3
|
- uses: https://code.forgejo.org/actions/checkout@v3
|
||||||
- uses: https://code.forgejo.org/actions/setup-go@v4
|
- uses: https://code.forgejo.org/actions/setup-go@v4
|
||||||
with:
|
with:
|
||||||
go-version: "1.21"
|
go-version: "1.21"
|
||||||
- run: |
|
- name: install dependencies
|
||||||
|
run: |
|
||||||
|
export DEBIAN_FRONTEND=noninteractive
|
||||||
|
apt-get update -qq
|
||||||
|
apt-get install --no-install-recommends -qq -y git-lfs
|
||||||
|
- name: setup user and permissions
|
||||||
|
run: |
|
||||||
git config --add safe.directory '*'
|
git config --add safe.directory '*'
|
||||||
chown -R gitea:gitea . /go
|
adduser --quiet --comment forgejo --disabled-password forgejo
|
||||||
|
chown -R forgejo:forgejo .
|
||||||
- run: |
|
- run: |
|
||||||
su gitea -c 'make deps-backend'
|
su forgejo -c 'make deps-backend'
|
||||||
- run: |
|
- run: |
|
||||||
su gitea -c 'make backend'
|
su forgejo -c 'make backend'
|
||||||
env:
|
env:
|
||||||
TAGS: bindata gogit sqlite sqlite_unlock_notify
|
TAGS: bindata gogit sqlite sqlite_unlock_notify
|
||||||
- run: |
|
- run: |
|
||||||
su gitea -c 'make test-sqlite-migration test-sqlite'
|
su forgejo -c 'make test-sqlite-migration test-sqlite'
|
||||||
timeout-minutes: 50
|
timeout-minutes: 50
|
||||||
env:
|
env:
|
||||||
TAGS: bindata gogit sqlite sqlite_unlock_notify
|
TAGS: bindata gogit sqlite sqlite_unlock_notify
|
||||||
|
|
Loading…
Reference in a new issue