refactor: use new handler abstractions in all handlers and middlewares #31
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: Tests | |
on: | |
push: | |
branches: | |
- "*" | |
paths-ignore: | |
- "README.md" | |
- ".gitignore" | |
- "Dockerfile" | |
- "docker-compose.yaml" | |
- "docker-compose.dev.yaml" | |
- "openapi.yaml" | |
- ".run" | |
jobs: | |
HTTP-Tests: | |
runs-on: ubuntu-latest | |
services: | |
db: | |
image: postgres:16 | |
env: | |
POSTGRES_PASSWORD: "changeme" | |
POSTGRES_USER: "godrink" | |
POSTGRES_DB: "godrink" | |
ports: | |
- "5432:5432" | |
volumes: | |
- pgdata:/var/lib/postgresql/data | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
- name: Setup Go | |
uses: actions/[email protected] | |
- name: Install dependencies | |
run: go get . | |
- name: Run Go-Drink | |
env: | |
GODRINK_DB: postgresql://godrink:changeme@localhost:5432/godrink?sslmode=disable | |
run: "go run . &" | |
- name: Execute HTTP requests | |
run: ./http-test/test.sh -t '**/*.http' -r test-reports -e http-test/http-client.env.json | |
timeout-minutes: 3 | |
- name: Upload Test results | |
if: success() || failure() # always run even if the previous step fails | |
uses: actions/[email protected] | |
with: | |
name: HTTP Test Report | |
path: ./test-reports/report.xml | |
Go-Tests: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
- name: Setup Go | |
uses: actions/[email protected] | |
- name: Install dependencies | |
run: go get . | |
- name: Test with Go | |
run: go test -json ./... > TestResults.json | |
- name: Upload Go test results | |
if: success() || failure() # always run even if the previous step fails | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Go Test Result | |
path: TestResults.json | |
- name: Convert GoTest JSON to JUnit XML | |
uses: pl-strflt/gotest-json-to-junit-xml@v1 | |
with: | |
input: TestResults.json | |
output: test-reports/TestResults-JUnit.xml | |
- name: Upload Go test JUnit report | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Go Test Report | |
path: test-reports/TestResults-JUnit.xml | |
Report: | |
needs: | |
- Go-Tests | |
- HTTP-Tests | |
if: always() | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
actions: read | |
checks: write | |
steps: | |
- name: Download Http-Test-Report | |
uses: actions/download-artifact@v4 | |
with: | |
pattern: "*Test Report*" | |
path: test-reports | |
merge-multiple: true | |
- name: Publish Test Report | |
uses: mikepenz/action-junit-report@v4 | |
with: | |
detailed_summary: true | |
include_passed: true | |
require_passed_tests: true | |
update_check: true | |
report_paths: "test-reports/*.xml" |