0
0
Fork 0
mirror of https://github.com/tj-actions/pg-dump.git synced 2024-12-20 01:18:49 +00:00

Updated test

This commit is contained in:
Tonye Jack 2023-09-12 12:54:21 -06:00
parent ab7ddd7bb1
commit ef05d54deb
2 changed files with 13 additions and 4 deletions

View file

@ -15,16 +15,18 @@ jobs:
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4 uses: actions/checkout@v4
- name: shellcheck - name: shellcheck
uses: reviewdog/action-shellcheck@v1.19 uses: reviewdog/action-shellcheck@v1.19
test-postgresql: test-postgresql:
name: Test pg_dump with PostgreSQL version name: Test pg_dump with PostgreSQL version
runs-on: ${{ matrix.platform }} runs-on: ${{ matrix.platform }}
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
platform: [ubuntu-latest, windows-latest, macos-latest, macos-11, windows-2022] platform: [ubuntu-latest, windows-latest, macos-latest, macos-11]
postgresql_version: [12, 14, 15] postgresql_version: [12, 14, 15]
services: services:
postgres: postgres:
@ -44,12 +46,14 @@ jobs:
with: with:
fetch-depth: 0 fetch-depth: 0
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token
- name: Run pg_dump - name: Run pg_dump
uses: ./ uses: ./
with: with:
database_url: "postgres://test_user:test_user_password@localhost:5432/testdb" database_url: "postgres://test_user:test_user_password@localhost:5432/testdb"
postgresql_version: ${{ matrix.postgresql_version }} postgresql_version: ${{ matrix.postgresql_version }}
path: "backups/${{ matrix.postgresql_version }}/backup.sql" path: "backups/${{ matrix.postgresql_version }}/backup.sql"
- name: Check changes to the backup file. - name: Check changes to the backup file.
id: changed_backup id: changed_backup
if: matrix.platform == 'ubuntu-latest' if: matrix.platform == 'ubuntu-latest'
@ -93,6 +97,7 @@ jobs:
with: with:
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token
- name: Run pg_dump - name: Run pg_dump
uses: ./ uses: ./
with: with:

View file

@ -19,13 +19,17 @@ inputs:
runs: runs:
using: 'composite' using: 'composite'
steps: steps:
- name: Setup PostgreSQL
uses: tj-actions/install-postgresql@v2
if: inputs.postgresql_version != ''
with:
postgresql-version: ${{ inputs.postgresql_version }}
- run: | - run: |
bash $GITHUB_ACTION_PATH/entrypoint.sh bash $GITHUB_ACTION_PATH/entrypoint.sh
shell: bash shell: bash
env: env:
# INPUT_<VARIABLE_NAME> is not available in Composite run steps # INPUT_<VARIABLE_NAME> is not available in Composite run steps
# https://github.community/t/input-variable-name-is-not-available-in-composite-run-steps/127611 # https://github.community/t/input-variable-name-is-not-available-in-composite-run-steps/127611
INPUT_POSTGRESQL_VERSION: ${{ inputs.postgresql_version }}
INPUT_PATH: ${{ inputs.path }} INPUT_PATH: ${{ inputs.path }}
INPUT_DATABASE_URL: ${{ inputs.database_url }} INPUT_DATABASE_URL: ${{ inputs.database_url }}
INPUT_OPTIONS: ${{ inputs.options }} INPUT_OPTIONS: ${{ inputs.options }}