Skip to content

feat: add timeout middleware #3553

feat: add timeout middleware

feat: add timeout middleware #3553

Workflow file for this run

name: Test
on:
pull_request:
push:
branches:
- master
tags: ['*']
jobs:
test:
strategy:
matrix:
go-version: [1.21.x]
runs-on: ubuntu-20.04
services:
postgres:
image: postgres:15
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: root
POSTGRES_DB: postgres
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v2
with:
skip-unshallow: "true"
- name: Check gofmt
run: |
set -x
if [ ! -z $(gofmt -l .) ]
then
echo 'Make sure to run "gofmt -s -w ." before commit!' && exit 1
fi
- name: Check go vet
run: |
set -x
go vet ./...
- name: Run static check
run: |
set -x
go install honnef.co/go/tools/cmd/staticcheck@latest
make static
- name: Check gosec
run: |
set -x
go install github.com/securego/gosec/v2/cmd/gosec@latest
make sec
- name: Init Database
run: psql -f hack/init_postgres.sql postgresql://postgres:root@localhost:5432/postgres
- name: Run migrations
run: make migrate_dev
- name: Lint and test
run: make test
- uses: shogo82148/actions-goveralls@v1
with:
path-to-profile: coverage.out