Skip to content

Commit

Permalink
Merge pull request #28 from DarkCoder26/main
Browse files Browse the repository at this point in the history
Add Github Workflow for Backend
  • Loading branch information
PreetinderSinghBadesha authored Jun 15, 2024
2 parents 348989e + d195891 commit 0ab2608
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/check-pull-requests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
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

- name: Install dependencies
run: cd backend && go mod tidy

- 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: cd backend && go test ./...

- name: Build the project
run: cd backend && go build -v -o main main.go

0 comments on commit 0ab2608

Please sign in to comment.