feat: run tests before deploy
All checks were successful
Deploy / build-and-deploy (push) Successful in 2m15s
All checks were successful
Deploy / build-and-deploy (push) Successful in 2m15s
This commit is contained in:
parent
1346abf733
commit
3ce7b556d0
1 changed files with 19 additions and 0 deletions
|
|
@ -6,9 +6,28 @@ on:
|
||||||
jobs:
|
jobs:
|
||||||
build-and-deploy:
|
build-and-deploy:
|
||||||
runs-on: ubuntu-full-24.04
|
runs-on: ubuntu-full-24.04
|
||||||
|
services:
|
||||||
|
postgres:
|
||||||
|
image: postgres:16-alpine
|
||||||
|
env:
|
||||||
|
POSTGRES_USER: budgit_test
|
||||||
|
POSTGRES_PASSWORD: testpass
|
||||||
|
POSTGRES_DB: budgit_test
|
||||||
|
options: >-
|
||||||
|
--health-cmd "pg_isready -U budgit_test -d budgit_test"
|
||||||
|
--health-interval 5s
|
||||||
|
--health-timeout 3s
|
||||||
|
--health-retries 10
|
||||||
|
--health-start-period 10s
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
- name: Run tests
|
||||||
|
env:
|
||||||
|
BUDGIT_TEST_POSTGRES_URL: "postgres://budgit_test:testpass@postgres:5432/budgit_test?sslmode=disable"
|
||||||
|
run: |
|
||||||
|
go tool templ generate
|
||||||
|
go test ./internal/... -count=1
|
||||||
- name: Build
|
- name: Build
|
||||||
run: task build
|
run: task build
|
||||||
- name: Setup SSH
|
- name: Setup SSH
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue