[ADD] HBA_EXTRA_RULES support to allow custom pg_hba.conf rules #84
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: ci | ||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- master | ||
schedule: | ||
# See https://crontab.guru/weekly | ||
- cron: 0 0 * * 0 | ||
jobs: | ||
pre-commit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v1 | ||
- name: Set PY | ||
run: | | ||
echo "PY=$(python -c 'import hashlib,sys;print(hashlib.sha256(sys.version.encode()+sys.executable.encode()).hexdigest())')" >> $GITHUB_ENV | ||
- uses: actions/cache@v1 | ||
with: | ||
path: ~/.cache/pre-commit | ||
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }} | ||
- uses: pre-commit/[email protected] | ||
build-test-push: | ||
runs-on: ubuntu-latest | ||
needs: pre-commit | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
pg_version: | ||
- "16" | ||
- "15" | ||
- "14" | ||
- "13" | ||
- "12" | ||
- "11" | ||
- "10" | ||
- "9.6" | ||
env: | ||
# Indicates what's the equivalent to tecnativa/postgres-autoconf:latest image | ||
LATEST_RELEASE: "16-alpine" | ||
DOCKER_REPO: tecnativa/postgres-autoconf | ||
DOCKER_TAG: ${{ matrix.pg_version }}-alpine | ||
GIT_SHA1: ${{ github.sha }} | ||
IS_PR: ${{ github.event_name == 'pull_request' }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v1 | ||
- run: pip install -r tests/ci-requirements.txt | ||
# Build images | ||
- run: ./hooks/build | ||
# Test | ||
- run: python -m unittest tests.test -v | ||
- name: Set Docker Tag | ||
run: | | ||
if [ "${{ env.IS_PR }}" = "true" ]; then | ||
echo "DOCKER_TAG=${{ matrix.pg_version }}-test-pr${{ github.event.number }}" >> $GITHUB_ENV | ||
docker tag ${{ env.DOCKER_REPO }}:${{ matrix.pg_version }}-alpine ${{ env.DOCKER_REPO }}:${{ DOCKER_TAG }} | ||
else | ||
echo "DOCKER_TAG=${{ matrix.pg_version }}-alpine" >> $GITHUB_ENV | ||
fi | ||
# Pushh | ||
- name: Push Docker Image to Docker Hub | ||
if: github.repository == 'Tecnativa/docker-postgres-autoconf' && (env.IS_PR || github.ref == 'refs/heads/master') | ||
env: | ||
REGISTRY_HOST: docker.io | ||
REGISTRY_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} | ||
REGISTRY_USERNAME: ${{ secrets.DOCKERHUB_LOGIN }} | ||
run: ./hooks/push | ||
- name: Push Docker Image to GitHub Registry | ||
if: github.repository == 'Tecnativa/docker-postgres-autoconf' && (env.IS_PR || github.ref == 'refs/heads/master') | ||
env: | ||
REGISTRY_HOST: ghcr.io | ||
REGISTRY_TOKEN: ${{ secrets.BOT_TOKEN }} | ||
REGISTRY_USERNAME: ${{ secrets.BOT_LOGIN }} | ||
run: ./hooks/push |