0
0
Fork 0
mirror of https://github.com/tj-actions/pg-dump.git synced 2024-12-20 01:18:49 +00:00
pg-dump/.github/workflows/test.yml
2021-01-30 21:55:16 -05:00

45 lines
1.1 KiB
YAML

name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
name: Test postgres-restore
services:
postgres:
image: postgres:9.6.20
env:
POSTGRES_USER: test_user
POSTGRES_PASSWORD: test_user_password
POSTGRES_DB: testdb
ports:
- 5432:5432
# needed because the postgres container does not provide a healthcheck
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Run pg_dump
uses: ./
with:
database_url: "postgres://test_user:test_user_password@localhost:5432/testdb"
path: "backups/backup.sql"
- name: Check changes to backup file.
id: changed_backup
uses: tj-actions/verify-changed-files@v5.1
with:
files: backups/backup.sql
- name: Raise error
if: steps.changed_backup.outputs.files_changed == 'true'
run: |
exit 1;