Skip to content

BEDS-1195 / e2e github actions pipeline changes #1215

BEDS-1195 / e2e github actions pipeline changes

BEDS-1195 / e2e github actions pipeline changes #1215

name: Backend-Integration-Test
on:
push:
paths:
- 'backend/**'
branches:
- main
- staging
pull_request:
paths:
- 'backend/**'
branches:
- '*'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
pull-requests: read
checks: write
jobs:
build:
services:
postgres:
image: postgres:15
env:
POSTGRES_DB: postgres
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U postgres"
--health-interval 5s
--health-timeout 5s
--health-retries 5
runs-on: ubuntu-latest
name: integration-test
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: backend/go.mod
cache-dependency-path: backend/go.sum
cache: true
- uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/.cache/gocache
key: go-${{ runner.os }}-${{ hashFiles('backend/go.sum') }}
restore-keys: |
go-${{ runner.os }}-
- name: Swag
working-directory: backend
run: |
go install github.com/swaggo/swag/cmd/swag@latest
swag init --ot json -o ./pkg/api/docs -d ./pkg/api/ -g ./handlers/public.go
- name: Tests
working-directory: backend
run: go test -failfast ./pkg/api/... -config "${{ secrets.CI_CONFIG_PATH }}"