mirror of
https://github.com/nicksherron/bashhub-server.git
synced 2025-09-05 03:44:30 +08:00
37 lines
860 B
YAML
37 lines
860 B
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [ master ]
|
|
pull_request:
|
|
branches: [ master ]
|
|
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
|
|
services:
|
|
postgres:
|
|
image: postgres:latest
|
|
env:
|
|
POSTGRES_DB: postgres
|
|
POSTGRES_PASSWORD: postgres
|
|
POSTGRES_USER: postgres
|
|
ports:
|
|
- 5432:5432
|
|
options: >-
|
|
--health-cmd pg_isready
|
|
--health-interval 10s
|
|
--health-timeout 5s
|
|
--health-retries 5
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Run tests with postgres
|
|
run: go test -v github.com/nicksherron/bashhub-server/internal -postgres-uri "postgres://postgres:postgres@localhost:5432?sslmode=disable"
|
|
|
|
- name: Run tests with sqlite
|
|
run: go test -v ./...
|