Skip to content

Commit 8a246d2

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)
1 parent 45c4c8f commit 8a246d2

File tree

8 files changed

+152
-574
lines changed

8 files changed

+152
-574
lines changed

.forgejo/workflows/testing.yml

Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
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+
steps:
39+
- uses: https://code.forgejo.org/actions/checkout@v3
40+
- uses: https://code.forgejo.org/actions/setup-go@v4
41+
with:
42+
go-version: ">=1.20.0"
43+
- run: |
44+
git config --add safe.directory '*'
45+
chown -R gitea:gitea . /go
46+
- run: |
47+
su gitea -c 'make deps-backend'
48+
- run: |
49+
su gitea -c 'make backend'
50+
env:
51+
TAGS: bindata
52+
- run: |
53+
su gitea -c 'make unit-test-coverage test-check'
54+
timeout-minutes: 50
55+
env:
56+
RACE_ENABLED: 'true'
57+
TAGS: bindata
58+
test-mysql:
59+
runs-on: docker
60+
needs: [lint-backend, checks-backend]
61+
container:
62+
image: codeberg.org/forgejo/test_env:main
63+
services:
64+
mysql8:
65+
image: mysql:8
66+
env:
67+
MYSQL_ALLOW_EMPTY_PASSWORD: yes
68+
MYSQL_DATABASE: testgitea
69+
ports:
70+
- "3306:3306"
71+
steps:
72+
- uses: https://code.forgejo.org/actions/checkout@v3
73+
- uses: https://code.forgejo.org/actions/setup-go@v4
74+
with:
75+
go-version: ">=1.20.0"
76+
- run: |
77+
git config --add safe.directory '*'
78+
chown -R gitea:gitea . /go
79+
- run: |
80+
su gitea -c 'make deps-backend'
81+
- run: |
82+
su gitea -c 'make backend'
83+
env:
84+
TAGS: bindata
85+
- run: |
86+
su gitea -c 'make test-mysql8-migration test-mysql8'
87+
timeout-minutes: 50
88+
env:
89+
TAGS: bindata
90+
USE_REPO_TEST_DIR: 1
91+
test-pgsql:
92+
runs-on: docker
93+
needs: [lint-backend, checks-backend]
94+
container:
95+
image: codeberg.org/forgejo/test_env:main
96+
services:
97+
pgsql:
98+
image: postgres:15
99+
env:
100+
POSTGRES_DB: test
101+
POSTGRES_PASSWORD: postgres
102+
ports:
103+
- "5432:5432"
104+
steps:
105+
- uses: https://code.forgejo.org/actions/checkout@v3
106+
- uses: https://code.forgejo.org/actions/setup-go@v4
107+
with:
108+
go-version: ">=1.20.0"
109+
- run: |
110+
git config --add safe.directory '*'
111+
chown -R gitea:gitea . /go
112+
- run: |
113+
su gitea -c 'make deps-backend'
114+
- run: |
115+
su gitea -c 'make backend'
116+
env:
117+
TAGS: bindata
118+
- run: |
119+
su gitea -c 'make test-pgsql-migration test-pgsql'
120+
timeout-minutes: 50
121+
env:
122+
TAGS: bindata gogit
123+
RACE_ENABLED: true
124+
TEST_TAGS: gogit
125+
USE_REPO_TEST_DIR: 1
126+
test-sqlite:
127+
runs-on: docker
128+
needs: [lint-backend, checks-backend]
129+
container:
130+
image: codeberg.org/forgejo/test_env:main
131+
steps:
132+
- uses: https://code.forgejo.org/actions/checkout@v3
133+
- uses: https://code.forgejo.org/actions/setup-go@v4
134+
with:
135+
go-version: ">=1.20.0"
136+
- run: |
137+
git config --add safe.directory '*'
138+
chown -R gitea:gitea . /go
139+
- run: |
140+
su gitea -c 'make deps-backend'
141+
- run: |
142+
su gitea -c 'make backend'
143+
env:
144+
TAGS: bindata gogit sqlite sqlite_unlock_notify
145+
- run: |
146+
su gitea -c 'make test-sqlite-migration test-sqlite'
147+
timeout-minutes: 50
148+
env:
149+
TAGS: bindata gogit sqlite sqlite_unlock_notify
150+
RACE_ENABLED: true
151+
TEST_TAGS: gogit sqlite sqlite_unlock_notify
152+
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)