Skip to content

Commit 6c8b680

Browse files
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 <git@yardenshoham.com>
1 parent 365bb77 commit 6c8b680

13 files changed

+173
-288
lines changed

.github/workflows/cron-licenses.yml

+8-9
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
1-
name: "Cron: Update licenses and gitignores"
1+
name: cron-licenses
22

33
on:
44
schedule:
5-
# weekly on Monday at 0:07 UTC
6-
- cron: "7 0 * * 1"
5+
- cron: "7 0 * * 1" # every Monday at 00:07 UTC
76

87
jobs:
9-
cron:
8+
cron-licenses:
9+
if: github.repository == "go-gitea/gitea"
1010
runs-on: ubuntu-latest
1111
steps:
12-
- name: Checkout
13-
uses: actions/checkout@v3
12+
- uses: actions/checkout@v3
1413
- uses: actions/setup-go@v3
1514
with:
16-
go-version: '>=1.20.1'
17-
- name: update licenses and gitignores
18-
run: timeout -s ABRT 40m make generate-license generate-gitignore
15+
go-version: ">=1.20.1"
16+
- run: make generate-license generate-gitignore
17+
timeout-minutes: 40
1918
- name: push translations to repo
2019
uses: appleboy/git-push-action@v0.0.2
2120
with:

.github/workflows/lock.yml .github/workflows/cron-lock.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
name: 'Lock Threads'
1+
name: cron-lock
22

33
on:
44
schedule:
5-
- cron: '0 0 * * *' # Run once a day
5+
- cron: "0 0 * * *" # every day at 00:00 UTC
66
workflow_dispatch:
77

88
permissions:

.github/workflows/cron-translations.yml

+6-8
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
1-
name: "Cron: Pull translations from Crowdin"
1+
name: cron-translations
22

33
on:
44
schedule:
5-
- cron: "7 0 * * *" # every day at 0:07 UTC
5+
- cron: "7 0 * * *" # every day at 00:07 UTC
66

77
jobs:
8-
crowdin_pull:
8+
crowdin-pull:
99
runs-on: ubuntu-latest
1010
steps:
11-
- name: Checkout
12-
uses: actions/checkout@v3
11+
- uses: actions/checkout@v3
1312
- name: download from crowdin
1413
uses: docker://jonasfranz/crowdin
1514
env:
@@ -30,11 +29,10 @@ jobs:
3029
commit_message: "[skip ci] Updated translations via Crowdin"
3130
remote: "git@github.com:go-gitea/gitea.git"
3231
ssh_key: ${{ secrets.DEPLOY_KEY }}
33-
crowdin_push:
32+
crowdin-push:
3433
runs-on: ubuntu-latest
3534
steps:
36-
- name: Checkout
37-
uses: actions/checkout@v3
35+
- uses: actions/checkout@v3
3836
- name: push translations to crowdin
3937
uses: docker://jonasfranz/crowdin
4038
env:

.github/workflows/push-publish_docs.yml .github/workflows/publish-docs.yml

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: "Docs: Publish"
1+
name: publish-docs
22

33
on:
44
push:
@@ -11,12 +11,10 @@ jobs:
1111
compliance-docs:
1212
runs-on: ubuntu-latest
1313
steps:
14-
- name: checkout
15-
uses: actions/checkout@v3
16-
- name: setup go
17-
uses: actions/setup-go@v4
14+
- uses: actions/checkout@v3
15+
- uses: actions/setup-go@v4
1816
with:
19-
go-version: '>=1.20.1'
17+
go-version: ">=1.20.1"
2018
- name: build docs
2119
run: |
2220
cd docs
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: compliance-docs
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- "docs/**"
7+
- "*.md"
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
compliance-docs:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v3
18+
- uses: actions/setup-node@v3
19+
with:
20+
node-version: 20
21+
- run: make deps-frontend
22+
- run: make lint-md

.github/workflows/pull-compliance.yml

+38-81
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: "Pull: Compliance Tests"
1+
name: compliance
22

33
on: [pull_request]
44

@@ -7,136 +7,93 @@ concurrency:
77
cancel-in-progress: true
88

99
jobs:
10-
lint_basic:
10+
lint-backend:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- name: checkout
14-
uses: actions/checkout@v3
15-
- name: setup go
16-
uses: actions/setup-go@v4
13+
- uses: actions/checkout@v3
14+
- uses: actions/setup-go@v4
1715
with:
18-
go-version: '>=1.20'
16+
go-version: ">=1.20"
1917
check-latest: true
20-
- name: deps-backend
21-
run: make deps-backend deps-tools
22-
- name: lint backend
23-
run: make lint-backend
18+
- run: make deps-backend deps-tools
19+
- run: make lint-backend
2420
env:
25-
GOPROXY: https://goproxy.io # proxy.golang.org is blocked in China, this proxy is not
26-
GOSUMDB: sum.golang.org
2721
TAGS: bindata sqlite sqlite_unlock_notify
28-
lint_windows:
22+
lint-go-windows:
2923
runs-on: ubuntu-latest
3024
steps:
31-
- name: checkout
32-
uses: actions/checkout@v3
33-
- name: setup go
34-
uses: actions/setup-go@v4
25+
- uses: actions/checkout@v3
26+
- uses: actions/setup-go@v4
3527
with:
36-
go-version: '>=1.20'
28+
go-version: ">=1.20"
3729
check-latest: true
38-
- name: deps-backend
39-
run: make deps-backend deps-tools
40-
- name: lint-backend-windows
41-
run: make lint-go-windows lint-go-vet
30+
- run: make deps-backend deps-tools
31+
- run: make lint-go-windows lint-go-vet
4232
env:
43-
GOPROXY: https://goproxy.io # proxy.golang.org is blocked in China, this proxy is not
44-
GOSUMDB: sum.golang.org
4533
TAGS: bindata sqlite sqlite_unlock_notify
4634
GOOS: windows
4735
GOARCH: amd64
48-
lint_gogit:
36+
lint-go-gogit:
4937
runs-on: ubuntu-latest
5038
steps:
51-
- name: checkout
52-
uses: actions/checkout@v3
53-
- name: setup go
54-
uses: actions/setup-go@v4
39+
- uses: actions/checkout@v3
40+
- uses: actions/setup-go@v4
5541
with:
56-
go-version: '>=1.20'
42+
go-version: ">=1.20"
5743
check-latest: true
58-
- name: deps-backend
59-
run: make deps-backend deps-tools
60-
- name: lint-backend-gogit
61-
run: make lint-backend
44+
- run: make deps-backend deps-tools
45+
- run: make lint-go
6246
env:
63-
GOPROXY: https://goproxy.io # proxy.golang.org is blocked in China, this proxy is not
64-
GOSUMDB: sum.golang.org
6547
TAGS: bindata gogit sqlite sqlite_unlock_notify
66-
- name: checks backend
67-
run: make --always-make checks-backend # ensure the 'go-licenses' make target runs
68-
check_backend:
48+
checks-backend:
6949
runs-on: ubuntu-latest
7050
steps:
71-
- name: checkout
72-
uses: actions/checkout@v3
73-
- name: setup go
74-
uses: actions/setup-go@v4
51+
- uses: actions/checkout@v3
52+
- uses: actions/setup-go@v4
7553
with:
76-
go-version: '>=1.20'
54+
go-version: ">=1.20"
7755
check-latest: true
78-
- name: deps-backend
79-
run: make deps-backend deps-tools
80-
- name: checks backend
81-
run: make --always-make checks-backend # ensure the 'go-licenses' make target runs
56+
- run: make deps-backend deps-tools
57+
- run: make --always-make checks-backend # ensure the "go-licenses" make target runs
8258
frontend:
8359
runs-on: ubuntu-latest
8460
steps:
85-
- name: checkout
86-
uses: actions/checkout@v3
87-
- name: setup node
88-
uses: actions/setup-node@v3
61+
- uses: actions/checkout@v3
62+
- uses: actions/setup-node@v3
8963
with:
9064
node-version: 20
91-
- name: deps-frontend
92-
run: make deps-frontend
93-
- name: lint frontend
94-
run: make lint-frontend
95-
- name: checks frontend
96-
run: make checks-frontend
97-
- name: test frontend
98-
run: make test-frontend
65+
- run: make deps-frontend
66+
- run: make lint-frontend
67+
- run: make checks-frontend
9968
backend:
10069
runs-on: ubuntu-latest
10170
steps:
102-
- name: checkout
103-
uses: actions/checkout@v3
104-
- name: setup go
105-
uses: actions/setup-go@v4
71+
- uses: actions/checkout@v3
72+
- uses: actions/setup-go@v4
10673
with:
107-
go-version: '>=1.20'
74+
go-version: ">=1.20"
10875
check-latest: true
109-
- name: setup node
110-
uses: actions/setup-node@v3
76+
- uses: actions/setup-node@v3
11177
with:
11278
node-version: 20
113-
- name: deps-backend
114-
run: make deps-backend deps-tools
115-
- name: deps-frontend
116-
run: make deps-frontend
117-
- name: build frontend
118-
run: make frontend
119-
- name: build-backend-no-gcc
120-
run: go build -o gitea_no_gcc # test if build succeeds without the sqlite tag
121-
env:
122-
GOPROXY: https://goproxy.io
79+
- run: make deps-backend deps-tools
80+
- run: make deps-frontend
81+
- run: make frontend
82+
- run: go build -o gitea_no_gcc # test if build succeeds without the sqlite tag
12383
- name: build-backend-arm64
12484
run: make backend # test cross compile
12585
env:
126-
GOPROXY: https://goproxy.io
12786
GOOS: linux
12887
GOARCH: arm64
12988
TAGS: bindata gogit
13089
- name: build-backend-windows
13190
run: go build -o gitea_windows
13291
env:
133-
GOPROXY: https://goproxy.io
13492
GOOS: windows
13593
GOARCH: amd64
13694
TAGS: bindata gogit
13795
- name: build-backend-386
13896
run: go build -o gitea_linux_386 # test if compatible with 32 bit
13997
env:
140-
GOPROXY: https://goproxy.io
14198
GOOS: linux
14299
GOARCH: 386

.github/workflows/pull-compliance_docs.yml

-26
This file was deleted.

0 commit comments

Comments
 (0)