Skip to content

Commit ed86e2f

Browse files
committed
Update workflow files (#131)
Reviewed-on: https://gitea.com/gitea/act_runner/pulls/131
1 parent d4bebcc commit ed86e2f

File tree

3 files changed

+54
-25
lines changed

3 files changed

+54
-25
lines changed

.gitea/workflows/release-nightly.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,34 @@ on:
44
push:
55
branches: [ main ]
66

7+
env:
8+
GOPATH: /go_path
9+
GOCACHE: /go_cache
10+
711
jobs:
812
goreleaser:
913
runs-on: ubuntu-latest
1014
steps:
1115
- uses: actions/checkout@v3
1216
with:
13-
fetch-depth: 0
14-
- run: git fetch --force --tags
17+
fetch-depth: 0 # all history for all branches and tags
1518
- uses: actions/setup-go@v3
1619
with:
1720
go-version: '>=1.20.1'
21+
- uses: https://gitea.com/actions/[email protected]
22+
id: hash-go
23+
with:
24+
patterns: |
25+
go.mod
26+
go.sum
27+
- name: cache go
28+
id: cache-go
29+
uses: https://github.com/actions/cache@v3
30+
with:
31+
path: |
32+
/go_path
33+
/go_cache
34+
key: go_path-${{ steps.hash-go.outputs.hash }}
1835
- name: goreleaser
1936
uses: https://github.com/goreleaser/goreleaser-action@v4
2037
with:

.gitea/workflows/release-tag.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,34 @@ on:
55
tags:
66
- '*'
77

8+
env:
9+
GOPATH: /go_path
10+
GOCACHE: /go_cache
11+
812
jobs:
913
goreleaser:
1014
runs-on: ubuntu-latest
1115
steps:
1216
- uses: actions/checkout@v3
1317
with:
14-
fetch-depth: 0
15-
- run: git fetch --force --tags
18+
fetch-depth: 0 # all history for all branches and tags
1619
- uses: actions/setup-go@v3
1720
with:
1821
go-version: '>=1.20.1'
22+
- uses: https://gitea.com/actions/[email protected]
23+
id: hash-go
24+
with:
25+
patterns: |
26+
go.mod
27+
go.sum
28+
- name: cache go
29+
id: cache-go
30+
uses: https://github.com/actions/cache@v3
31+
with:
32+
path: |
33+
/go_path
34+
/go_cache
35+
key: go_path-${{ steps.hash-go.outputs.hash }}
1936
- name: Import GPG key
2037
id: import_gpg
2138
uses: https://github.com/crazy-max/ghaction-import-gpg@v5

.gitea/workflows/test.yml

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ on:
44
- pull_request
55

66
env:
7-
GOPROXY: https://goproxy.io,direct
87
GOPATH: /go_path
98
GOCACHE: /go_cache
109

@@ -13,31 +12,27 @@ jobs:
1312
name: check and test
1413
runs-on: ubuntu-latest
1514
steps:
16-
- name: cache go path
17-
id: cache-go-path
18-
uses: https://github.com/actions/cache@v3
15+
- uses: actions/checkout@v3
16+
- uses: actions/setup-go@v3
1917
with:
20-
path: /go_path
21-
key: go_path-${{ github.repository }}-${{ github.ref_name }}
22-
restore-keys: |
23-
go_path-${{ github.repository }}-
24-
go_path-
25-
- name: cache go cache
26-
id: cache-go-cache
27-
uses: https://github.com/actions/cache@v3
18+
go-version: '>=1.20.1'
19+
- uses: https://gitea.com/actions/[email protected]
20+
id: hash-go
2821
with:
29-
path: /go_cache
30-
key: go_cache-${{ github.repository }}-${{ github.ref_name }}
31-
restore-keys: |
32-
go_cache-${{ github.repository }}-
33-
go_cache-
34-
- uses: actions/setup-go@v3
22+
patterns: |
23+
go.mod
24+
go.sum
25+
- name: cache go
26+
id: cache-go
27+
uses: https://github.com/actions/cache@v3
3528
with:
36-
go-version: 1.20
37-
- uses: actions/checkout@v3
29+
path: |
30+
/go_path
31+
/go_cache
32+
key: go_path-${{ steps.hash-go.outputs.hash }}
3833
- name: vet checks
3934
run: make vet
4035
- name: build
4136
run: make build
4237
- name: test
43-
run: make test
38+
run: make test

0 commit comments

Comments
 (0)