persistence/.gitea/workflows/test.yaml

45 lines
1.3 KiB
YAML
Raw Normal View History

2024-12-17 14:05:14 +05:00
name: Unit tests
run-name: ${{ gitea.actor }} is testing
on: push
2024-12-17 18:11:15 +05:00
env:
registry: my_registry_name
# Not sure these are actually being passed down to rails, set them as the default in database.yml
DB_HOST: localhost
DB_USERNAME: postgres
DB_PASSWORD: postgres
2024-12-17 14:05:14 +05:00
jobs:
test:
runs-on: ubuntu-latest
# Service containers to run with `runner-job`
services:
# Label used to access the service container
postgres:
# Docker Hub image
2024-12-17 15:22:53 +05:00
image: postgres
2024-12-17 14:05:14 +05:00
# Provide the password for postgres
env:
2024-12-17 14:39:29 +05:00
POSTGRES_USER: postgres
2024-12-17 14:05:14 +05:00
POSTGRES_PASSWORD: postgres
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps tcp port 5432 on service container to the host
2024-12-17 15:24:50 +05:00
- 5442:5432
2024-12-17 14:05:14 +05:00
steps:
- name: Setup dotnet
if: ${{ steps.cache-dotnet.outputs.cache-hit != 'true' }}
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Check out repository code
uses: actions/checkout@v4
2024-12-17 14:48:35 +05:00
- name: Run integration tests
2024-12-17 14:50:43 +05:00
run: dotnet test DD.Persistence.IntegrationTests