-
Notifications
You must be signed in to change notification settings - Fork 16
54 lines (45 loc) · 1.04 KB
/
check-pull-requests.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
name: Go CI with Redis
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
services:
redis:
image: redis:latest
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.20.4
- name: Install dependencies
run: go mod tidy
working-directory: ./backend
- name: Wait for Redis to be ready
run: |
until nc -z localhost 6379; do
echo "Waiting for Redis..."
sleep 1
done
# - name: Run tests
# env:
# REDIS_URL: redis://localhost:6379
# run: go test ./...
# working-directory: ./backend
- name: Build the project
run: go build -v -o main main.go
working-directory: ./backend