Skip to content

Fetching an existing table from postgres correctly orders the columns… #170

Fetching an existing table from postgres correctly orders the columns…

Fetching an existing table from postgres correctly orders the columns… #170

name: Postgres CI Build
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
config: Release
disable_test_parallelization: true
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
db_name: weasel_testing
db_user: test_user
db_pwd: P@55w0rd
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
# define the test matrix
matrix:
postgres-image:
- ionx/postgres-plv8:12.2
- postgres:15.3-alpine
useCaseSensitiveQualifiedNames:
- true
- false
name: Postgres ${{ matrix.postgres-image }} Case Sensitive ${{ matrix.useCaseSensitiveQualifiedNames }}
services:
postgres:
image: ${{ matrix.postgres-image }}
ports:
- 5432:5432
env:
POSTGRES_HOST_AUTH_METHOD: trust
POSTGRES_DB: ${{ env.db_name }}
POSTGRES_USER: ${{ env.db_user }}
USE_CASE_SENSITIVE_QUALIFIED_NAMES: ${{ matrix.useCaseSensitiveQualifiedNames }}
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- name: Optimize Postgres database for running tests faster
run: |
PG_CONTAINER_NAME=$(docker ps --filter expose=5432/tcp --format {{.Names}})
docker exec $PG_CONTAINER_NAME bash -c "echo -e '\nfsync = off' >> /var/lib/postgresql/data/postgresql.conf"
docker container restart $PG_CONTAINER_NAME
shell: bash
- name: Setup .NET 6
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
- name: Setup .NET 7
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- name: Setup .NET 8
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Test
env:
weasel_postgresql_testing_database: "Host=localhost;Database=${{ env.db_name }};Username=${{ env.db_user }};Password=${{ env.db_pwd }};"
run: dotnet test src/Weasel.Postgresql.Tests/Weasel.Postgresql.Tests.csproj --no-build --verbosity normal