-
-
Notifications
You must be signed in to change notification settings - Fork 94
50 lines (46 loc) · 1.58 KB
/
ci.yml
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
name: build
on: [push, pull_request]
jobs:
golangci:
name: Lint
runs-on: ubuntu-latest
# Prevent duplicate builds on internal PRs.
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.22.x'
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.58.0
args: --timeout 3m0s
build:
name: Test with Go ${{ matrix.go-version }} Redis ${{ matrix.redis-version }}
runs-on: ubuntu-latest
# Prevent duplicate builds on internal PRs.
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
strategy:
matrix:
go-version: ["1.21", "1.22"]
redis-version: [6, 7]
steps:
- name: Install Go stable version
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v4
- name: Start redis
env:
REDIS_VERSION: ${{ matrix.redis-version }}
run: docker compose up -d --wait
- name: Test
run: go test -v -race -tags integration -coverprofile=coverage.out $(go list ./... | grep -v /_examples/)
- name: Upload code coverage to codecov
if: matrix.go-version == '1.22' && matrix.redis-version == 7
uses: codecov/codecov-action@v4
with:
file: ./coverage.out
token: ${{ secrets.CODECOV_TOKEN }}