File tree Expand file tree Collapse file tree 2 files changed +54
-54
lines changed
Expand file tree Collapse file tree 2 files changed +54
-54
lines changed Original file line number Diff line number Diff line change 1- name : Release
2-
3- permissions :
4- contents : write
5- packages : write
1+ name : Test
62
73on :
84 push :
9- tags :
10- - ' v*'
115
126jobs :
13- release :
7+ test :
148 runs-on : ubuntu-latest
9+ services :
10+ postgres :
11+ image : postgres:12.3-alpine
12+ ports :
13+ - 5432:5432
14+ env :
15+ POSTGRES_PASSWORD : secret
16+ POSTGRES_USER : krab
17+ POSTGRES_DB : krab
18+ options : >-
19+ --health-cmd pg_isready
20+ --health-interval 10s
21+ --health-timeout 5s
22+ --health-retries 5
23+
1524 steps :
16- -
17- uses : actions/checkout@v5
18- -
25+ - uses : actions/checkout@v5
26+
27+ - name : Setup go
1928 uses : actions/setup-go@v4
2029 with :
2130 go-version : 1.21.4
22- -
23- name : Release
24- uses : goreleaser/goreleaser-action@v2
31+
32+ - uses : actions/cache@v3
2533 with :
26- distribution : goreleaser
27- version : latest
28- args : release --rm-dist
34+ path : |
35+ ~/.cache/go-build
36+ ~/go/pkg/mod
37+ key : ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
38+ restore-keys : |
39+ ${{ runner.os }}-go-
40+
41+ - name : Run tests
2942 env :
30- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
43+ DATABASE_URL : " postgres://krab:secret@localhost:5432/krab?sslmode=disable&prefer_simple_protocol=true"
44+ run : |
45+ mkdir -p bin/
46+ make install
47+ make gen
48+ go test -v ./...
Original file line number Diff line number Diff line change 1- name : Test
1+ name : Release
2+
3+ permissions :
4+ contents : write
5+ packages : write
26
37on :
48 push :
9+ tags :
10+ - ' v*'
511
612jobs :
7- test :
13+ release :
814 runs-on : ubuntu-latest
9- services :
10- postgres :
11- image : postgres:12.3-alpine
12- ports :
13- - 5432:5432
14- env :
15- POSTGRES_PASSWORD : secret
16- POSTGRES_USER : krab
17- POSTGRES_DB : krab
18- options : >-
19- --health-cmd pg_isready
20- --health-interval 10s
21- --health-timeout 5s
22- --health-retries 5
23-
2415 steps :
25- - uses : actions/checkout@v5
26-
27- - name : Setup go
16+ -
17+ uses : actions/checkout@v5
18+ -
2819 uses : actions/setup-go@v4
2920 with :
3021 go-version : 1.21.4
31-
32- - uses : actions/cache@v3
22+ -
23+ name : Release
24+ uses : goreleaser/goreleaser-action@v2
3325 with :
34- path : |
35- ~/.cache/go-build
36- ~/go/pkg/mod
37- key : ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
38- restore-keys : |
39- ${{ runner.os }}-go-
40-
41- - name : Run tests
26+ distribution : goreleaser
27+ version : latest
28+ args : release --rm-dist
4229 env :
43- DATABASE_URL : " postgres://krab:secret@localhost:5432/krab?sslmode=disable&prefer_simple_protocol=true"
44- run : |
45- mkdir -p bin/
46- make install
47- make gen
48- go test -v ./...
30+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments