Skip to content

#2941 Tests for: Using Explicit Code for Marten live aggregate projections #482

#2941 Tests for: Using Explicit Code for Marten live aggregate projections

#2941 Tests for: Using Explicit Code for Marten live aggregate projections #482

name: build_net6.0 pg12-plv8 System.Text.Json
on:
push:
branches:
- master
paths-ignore:
- 'documentation/**'
- 'docs/**'
- 'azure-pipelines.yml'
pull_request:
branches:
- master
paths-ignore:
- 'documentation/**'
- 'docs/**'
- 'azure-pipelines.yml'
env:
config: Release
disable_test_parallelization: true
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
node_version: 16.x
pg_db: marten_testing
pg_user: postgres
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 20
services:
postgres:
image: ionx/postgres-plv8:12.8
ports:
- 5432:5432
env:
POSTGRES_HOST_AUTH_METHOD: trust
POSTGRES_DB: ${{ env.pg_db }}
NAMEDATALEN: 150
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- name: Install .NET 6.0.x
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
- name: Install .NET 7.0.x
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- name: Install .NET 8.0.x
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ env.node_version }}
- name: Check and install plv8 extension
run: |
PG_CONTAINER_NAME=$(docker ps --filter expose=5432/tcp --format {{.Names}})
docker exec $PG_CONTAINER_NAME psql -U ${{ env.pg_user }} -d ${{ env.pg_db }} -c "CREATE EXTENSION IF NOT EXISTS plv8;"
docker exec $PG_CONTAINER_NAME psql -U ${{env.pg_user}} -d ${{ env.pg_db }} -c "DO 'plv8.elog(NOTICE, plv8.version);' LANGUAGE plv8;"
shell: bash
- name: Optimize 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 exec $PG_CONTAINER_NAME bash -c "echo -e '\nfull_page_writes = off' >> /var/lib/postgresql/data/postgresql.conf"
docker exec $PG_CONTAINER_NAME bash -c "echo -e '\nsynchronous_commit = off' >> /var/lib/postgresql/data/postgresql.conf"
docker container restart $PG_CONTAINER_NAME
shell: bash
- name: Build
env:
DEFAULT_SERIALIZER: "SystemTextJson"
marten_testing_database: "Host=localhost;Port=5432;Database=${{ env.pg_db }};Username=${{ env.pg_user }}"
run: dotnet run --project build/build.csproj -f net6.0 -c Release -- ci
shell: bash
- name: Test Extensions
env:
DEFAULT_SERIALIZER: "SystemTextJson"
marten_testing_database: "Host=localhost;Port=5432;Database=${{ env.pg_db }};Username=${{ env.pg_user }}"
run: dotnet run --project build/build.csproj -f net6.0 -c Release -- test-extension-libs
shell: bash