Skip to content

Commit cf45809

Browse files
committed
[CI] Forgejo Actions based CI for PR & branches
(cherry picked from commit f9d75d4705ece5c119f2fd5e2bfbaf630d0bf739) (cherry picked from commit 64f76f4ab269daa6a584305164732c68be0161c5) (cherry picked from commit 5d024541551f1be98444923f0fa327a855104725) [CI] Forgejo Actions workflows (cherry picked from commit 3ff59b5379ebf761f32875f9d869a1d18f79741c) (cherry picked from commit 8af826a6f7c70d03079ec68f10230041695017cd) (cherry picked from commit d7c09d9cc80037a28d488da142ae2a2a99f59ac9) [CI] use the docker label instead of ubuntu-latest (cherry picked from commit b6a6470db6c8bae9963e204f9c8c408f309e81e3) [CI] all tests need compliance before proceeding (cherry picked from commit b35c496f2c3034164b9bb3a3550f35026adf9372) (cherry picked from commit 36a4148a8ec654ae9fa5a6925a3b8606b96aebcc) (cherry picked from commit 7ffcffa653808a284f422fdc31f6ea07874b585d) (cherry picked from commit 8a246d2) (cherry picked from commit dd0b6e1826ba7699f967de2c00c1332909a53473) [CI] Forgejo Actions based release process (squash) MySQL optimization Refs: https://codeberg.org/forgejo/forgejo/issues/976 (cherry picked from commit b4b8c489e6e9fe36349eced5d4249467b25df2a7) (cherry picked from commit 1e861db4afdc32549784381a96b16dac508ec1c0) (cherry picked from commit a6c0e00330ded851c2f524039259f0b723d793e4) (cherry picked from commit f97b336465fd6be15079e756c9ee3a580f0aa339) (cherry picked from commit 6d65d5f0d6f798556a8f9e547896be03a5ee2f87) (cherry picked from commit 79bfbadbed3bf84b96f2c027d119a4aa5c60d5e2) (cherry picked from commit e86c40a34a97fc568c724ee5f8ee5b2bf46ebf19) (cherry picked from commit da0c454adbcf1b5dbb95d9d74afaa371e32351a0) (cherry picked from commit b49d892cda968b22ad6c29caade042690d96f2e2) [CI] enable minio tests (cherry picked from commit 4d8f4380311b872061bd20f561424662ecd8d817) (cherry picked from commit c4eeb0a61ef579c21b0382edd61c62adebe93b28) [CI] Forgejo Actions based CI for PR & branches (squash) cleanup (cherry picked from commit 80eb20e84267552c971096693558734f0ec7afdd) (cherry picked from commit d2ff589858961e4f25bc1d903cdf57df1db4c316) (cherry picked from commit f6eedecb67fce992605bb1fcdd93c866ec47a9d4)
1 parent 84ac6f3 commit cf45809

File tree

9 files changed

+164
-606
lines changed

9 files changed

+164
-606
lines changed

.forgejo/workflows/testing.yml

Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
name: testing
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- 'forgejo*'
8+
- 'v*/forgejo*'
9+
10+
jobs:
11+
lint-backend:
12+
runs-on: docker
13+
steps:
14+
- uses: https://code.forgejo.org/actions/checkout@v3
15+
- uses: https://code.forgejo.org/actions/setup-go@v4
16+
with:
17+
go-version: ">=1.20"
18+
check-latest: true
19+
- run: make deps-backend deps-tools
20+
- run: make lint-backend
21+
env:
22+
TAGS: bindata sqlite sqlite_unlock_notify
23+
checks-backend:
24+
runs-on: docker
25+
steps:
26+
- uses: https://code.forgejo.org/actions/checkout@v3
27+
- uses: https://code.forgejo.org/actions/setup-go@v4
28+
with:
29+
go-version: ">=1.20"
30+
check-latest: true
31+
- run: make deps-backend deps-tools
32+
- run: make --always-make checks-backend # ensure the "go-licenses" make target runs
33+
test-unit:
34+
runs-on: docker
35+
needs: [lint-backend, checks-backend]
36+
container:
37+
image: codeberg.org/forgejo/test_env:main
38+
services:
39+
minio:
40+
image: bitnami/minio:2021.3.17
41+
env:
42+
MINIO_ACCESS_KEY: 123456
43+
MINIO_SECRET_KEY: 12345678
44+
steps:
45+
- uses: https://code.forgejo.org/actions/checkout@v3
46+
- uses: https://code.forgejo.org/actions/setup-go@v4
47+
with:
48+
go-version: ">=1.20.0"
49+
- run: |
50+
git config --add safe.directory '*'
51+
chown -R gitea:gitea . /go
52+
- run: |
53+
su gitea -c 'make deps-backend'
54+
- run: |
55+
su gitea -c 'make backend'
56+
env:
57+
TAGS: bindata
58+
- run: |
59+
su gitea -c 'make unit-test-coverage test-check'
60+
timeout-minutes: 50
61+
env:
62+
RACE_ENABLED: 'true'
63+
TAGS: bindata
64+
test-mysql:
65+
runs-on: docker
66+
needs: [lint-backend, checks-backend]
67+
container:
68+
image: codeberg.org/forgejo/test_env:main
69+
services:
70+
mysql8:
71+
image: mysql:8-debian
72+
env:
73+
MYSQL_ALLOW_EMPTY_PASSWORD: yes
74+
MYSQL_DATABASE: testgitea
75+
#
76+
# See also https://codeberg.org/forgejo/forgejo/issues/976
77+
#
78+
cmd: ['mysqld', '--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']
79+
steps:
80+
- uses: https://code.forgejo.org/actions/checkout@v3
81+
- uses: https://code.forgejo.org/actions/setup-go@v4
82+
with:
83+
go-version: ">=1.20.0"
84+
- run: |
85+
git config --add safe.directory '*'
86+
chown -R gitea:gitea . /go
87+
- run: |
88+
su gitea -c 'make deps-backend'
89+
- run: |
90+
su gitea -c 'make backend'
91+
env:
92+
TAGS: bindata
93+
- run: |
94+
su gitea -c 'make test-mysql8-migration test-mysql8'
95+
timeout-minutes: 50
96+
env:
97+
TAGS: bindata
98+
USE_REPO_TEST_DIR: 1
99+
test-pgsql:
100+
runs-on: docker
101+
needs: [lint-backend, checks-backend]
102+
container:
103+
image: codeberg.org/forgejo/test_env:main
104+
services:
105+
minio:
106+
image: bitnami/minio:2021.3.17
107+
env:
108+
MINIO_ACCESS_KEY: 123456
109+
MINIO_SECRET_KEY: 12345678
110+
pgsql:
111+
image: postgres:15
112+
env:
113+
POSTGRES_DB: test
114+
POSTGRES_PASSWORD: postgres
115+
steps:
116+
- uses: https://code.forgejo.org/actions/checkout@v3
117+
- uses: https://code.forgejo.org/actions/setup-go@v4
118+
with:
119+
go-version: ">=1.20.0"
120+
- run: |
121+
git config --add safe.directory '*'
122+
chown -R gitea:gitea . /go
123+
- run: |
124+
su gitea -c 'make deps-backend'
125+
- run: |
126+
su gitea -c 'make backend'
127+
env:
128+
TAGS: bindata
129+
- run: |
130+
su gitea -c 'make test-pgsql-migration test-pgsql'
131+
timeout-minutes: 50
132+
env:
133+
TAGS: bindata gogit
134+
RACE_ENABLED: true
135+
TEST_TAGS: gogit
136+
USE_REPO_TEST_DIR: 1
137+
test-sqlite:
138+
runs-on: docker
139+
needs: [lint-backend, checks-backend]
140+
container:
141+
image: codeberg.org/forgejo/test_env:main
142+
steps:
143+
- uses: https://code.forgejo.org/actions/checkout@v3
144+
- uses: https://code.forgejo.org/actions/setup-go@v4
145+
with:
146+
go-version: ">=1.20.0"
147+
- run: |
148+
git config --add safe.directory '*'
149+
chown -R gitea:gitea . /go
150+
- run: |
151+
su gitea -c 'make deps-backend'
152+
- run: |
153+
su gitea -c 'make backend'
154+
env:
155+
TAGS: bindata gogit sqlite sqlite_unlock_notify
156+
- run: |
157+
su gitea -c 'make test-sqlite-migration test-sqlite'
158+
timeout-minutes: 50
159+
env:
160+
TAGS: bindata gogit sqlite sqlite_unlock_notify
161+
RACE_ENABLED: true
162+
TEST_TAGS: gogit sqlite sqlite_unlock_notify
163+
USE_REPO_TEST_DIR: 1

.github/workflows/cron-licenses.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.

.github/workflows/cron-lock.yml

Lines changed: 0 additions & 22 deletions
This file was deleted.

.github/workflows/cron-translations.yml

Lines changed: 0 additions & 49 deletions
This file was deleted.

0 commit comments

Comments
 (0)