-
Notifications
You must be signed in to change notification settings - Fork 1
59 lines (55 loc) · 1.59 KB
/
test.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: test
on: [push]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
redis-version: [6]
go: ["1.22"]
steps:
- uses: actions/checkout@v2
- name: Sets up a Memcached server
uses: niden/actions-memcached@v7
- name: Start Redis
uses: supercharge/[email protected]
with:
redis-version: ${{ matrix.redis-version }}
- uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go }}
- name: install deps
run: go mod tidy
- name: run test
run: go test -v -coverprofile=profile.cov ./...
- name: Send coverage to coverall.io
uses: shogo82148/actions-goveralls@v1
with:
path-to-profile: profile.cov
flag-name: Go-${{ matrix.go }}
parallel: true
# notifies that all test jobs are finished.
finish:
needs: test
runs-on: ubuntu-latest
steps:
- uses: shogo82148/actions-goveralls@v1
with:
parallel-finished: true
release-on-push:
runs-on: ubuntu-latest
needs:
- test
- finish
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: rymndhng/release-on-push-action@master
id: release_package
with:
bump_version_scheme: patch
- name: update go.pkg.dev with new version
env:
VERSION: ${{steps.release_package.outputs.version}}
run: curl https://sum.golang.org/lookup/github.com/${GITHUB_REPOSITORY}@${VERSION}