fix #10
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: Rust tests | ||
on: | ||
push: | ||
branches: | ||
- v3 | ||
env: | ||
jobs: | ||
tests: | ||
runs-on: ubuntu-latest | ||
services: | ||
postgres: | ||
image: postgres | ||
env: | ||
POSTGRES_PASSWORD: postgres | ||
POSTGRES_USER: postgres | ||
POSTGRES_DB: postgres | ||
options: >- | ||
--health-cmd pg_isready | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
ports: | ||
- 5432:5432 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.21.5' | ||
- name: Install Task | ||
uses: arduino/setup-task@v1 | ||
with: | ||
version: 3.x | ||
- name: 'Create env file' | ||
run: | | ||
touch .env | ||
echo DATABASE_TEST_DSN="host=localhost user=postgres password=postgres dbname=postgres port=5432 sslmode=disable" >> .env | ||
echo DATABASE_TEST_URL="postgres://postgres:postgres@localhost/postgres" | ||
cat .env | ||
- name: Run migration | ||
run: task db:test-migrate | ||
- name: run tests | ||
run: cargo test |