-
Notifications
You must be signed in to change notification settings - Fork 503
85 lines (81 loc) · 2.09 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
---
name: continuous-integration
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
lint:
runs-on: ubuntu-latest
env:
GOLANGCI_LINT_VERSION: v1.61.0
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
cache: true
- name: Lint code
uses: golangci/golangci-lint-action@v6
with:
version: ${{ env.GOLANGCI_LINT_VERSION }}
build:
env:
ATHENS_MONGO_STORAGE_URL: mongodb://localhost:27017
ATHENS_MINIO_ENDPOINT: http://localhost:9000
REDIS_TEST_ENDPOINT: localhost:6379
REDIS_SENTINEL_TEST_ENDPOINT: localhost:26379
REDIS_SENTINEL_TEST_MASTER_NAME: redis-1
REDIS_SENTINEL_TEST_PASSWORD: sekret
PROTECTED_REDIS_TEST_ENDPOINT: localhost:6380
ATHENS_PROTECTED_REDIS_PASSWORD: AthensPass1
GA_PULL_REQUEST: ${{github.event.number}}
runs-on: ubuntu-latest
services:
mongo:
image: mongo
ports:
- 27017:27017
minio:
image: minio/minio:edge-cicd
ports:
- 9000:9000
env:
MINIO_ACCESS_KEY: minio
MINIO_SECRET_KEY: minio123
redis:
image: redis
ports:
- 6379:6379
redis-sentinel:
image: bitnami/redis-sentinel
env:
REDIS_MASTER_HOST: redis
REDIS_MASTER_SET: redis-1
REDIS_SENTINEL_PASSWORD: sekret
REDIS_SENTINEL_QUORUM: "1"
ports:
- 26379:26379
protectedredis:
image: bitnami/redis
ports:
- 6380:6380
env:
REDIS_PORT_NUMBER: 6380
REDIS_PASSWORD: AthensPass1
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
cache: true
- name: Verify changes
run: make verify
- name: Unit tests
run: go test -v -race ./...
- name: End to end tests
if: success() || failure()
run: make test-e2e