Skip to content

Support infinite intervals #624

Support infinite intervals

Support infinite intervals #624

Workflow file for this run

name: CI
on:
push:
branches:
- master
pull_request:
jobs:
test:
runs-on: ubuntu-22.04
services:
pg:
image: postgres:${{ matrix.pg.version }}
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 10
ports:
- 5432:5432
volumes:
- /var/run/postgresql:/var/run/postgresql
strategy:
fail-fast: false
matrix:
pg:
- version: "9.4"
skip_wal: skip_wal
- version: "9.5"
skip_wal: skip_wal
- version: "9.6"
skip_wal: skip_wal
- version: "10"
- version: "11"
- version: "12"
- version: "13"
- version: "14"
- version: "15"
- version: "16"
- version: "17"
- version: "18"
pair:
- elixir: "1.15"
otp: "25"
include:
- pg:
version: "18"
pair:
elixir: "1.19"
otp: "28"
lint: lint
env:
MIX_ENV: test
steps:
- name: "Set PG settings"
run: |
PG_ID=${{ job.services.pg.id }}
# PG 18 config path is different from previous versions
# - /var/lib/postgresql/18/docker/postgresql.conf (PG 18)
# - /var/lib/postgresql/data/postgresql.conf (PG 17 and below)
# Dynamically find the path to postgresql.conf using psql
# We use the credentials from the service environment
CONFIG_FILE=$(docker exec $PG_ID psql -U postgres -d postgres -t -A -c 'SHOW config_file;')
# Trim whitespace and ensure the path is valid
CONFIG_FILE=$(echo $CONFIG_FILE | xargs)
if [ -z "$CONFIG_FILE" ]; then
echo "Error: Could not determine postgresql.conf path dynamically."
exit 1
fi
echo "Found config file at: $CONFIG_FILE"
# Use the discovered path to append the setting and restart the database
docker exec $PG_ID sh -c 'echo "wal_level=logical" >> '"$CONFIG_FILE"
docker restart $PG_ID
if: ${{ matrix.pg.skip_wal }} != 'skip_wal'
- uses: actions/checkout@v5
- uses: erlef/setup-beam@v1
with:
otp-version: ${{matrix.pair.otp}}
elixir-version: ${{matrix.pair.elixir}}
- uses: actions/cache@v4
with:
path: |
deps
_build
key: ${{ runner.os }}-mix-${{matrix.pair.elixir}}-${{matrix.pair.otp}}-${{ hashFiles('**/mix.lock') }}
restore-keys: |
${{ runner.os }}-mix-
- run: mix deps.get
- run: mix format --check-formatted
if: ${{ matrix.lint }}
- run: mix deps.unlock --check-unused
if: ${{ matrix.lint }}
- run: mix deps.compile
- run: mix compile --warnings-as-errors
if: ${{ matrix.lint }}
- run: mix test
env:
PGUSER: postgres
PGPASSWORD: postgres
PG_SOCKET_DIR: /var/run/postgresql