singhdurgesh is running Test Suites #7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "CI-TEST-SUITE" | |
run-name: ${{ github.actor }} is running Test Suites | |
on: | |
# To save cost, we only want to run CI for opened pull request by default | |
# Some branch like master is an exception | |
pull_request: | |
# Only runs if PR on master or main branch | |
branches: | |
- "main" | |
# Reference: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request | |
types: | |
- opened | |
- reopened | |
- synchronize | |
- ready_for_review | |
push: | |
branches: | |
- 'master' | |
paths-ignore: | |
- '.github/**' | |
- '.dependabot/**' | |
- 'eol.txt' | |
- 'docker-compose*' | |
- 'README.md' | |
- 'deployments/Dockerfile*' | |
- '.dockerignore' | |
workflow_dispatch: | |
env: | |
BRANCH_NAME: ${{ github.head_ref || github.ref_name }} | |
jobs: | |
# If we enable DUAL_CI, we will run CI for both Gemfile.lock & Gemfile.next.lock | |
# Otherwise, just run for Gemfile.lock | |
build: | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgis/postgis:12-3.4-alpine | |
volumes: | |
- postgres:/var/lib/postgresql/data | |
ports: | |
- "5432:5432" | |
env: | |
POSTGRES_PASSWORD: postgres | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
redis: | |
image: redis:4.0-alpine | |
volumes: | |
- redis:/data | |
ports: | |
- "6379:6379" | |
options: >- | |
--health-cmd "redis-cli ping" | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
rabbit_mq: | |
image: rabbitmq:3-management-alpine | |
ports: | |
- 5672:5672 | |
options: >- | |
--health-cmd "rabbitmq-diagnostics -q ping" | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
strategy: | |
matrix: | |
go-version: [1.21] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Go ${{ matrix.go-version }} | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ matrix.go-version }} | |
# Check if the Go has been installed with Correct Version | |
- name: Display Go version | |
run: go version | |
- name: Install dependencies | |
run: go get . | |
- name: Test with Go | |
run: go test ./... |