From ef05d54deb7690d524a3f5201c74c1af359e4cbb Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Tue, 12 Sep 2023 12:54:21 -0600 Subject: [PATCH] Updated test --- .github/workflows/test.yml | 11 ++++++++--- action.yml | 6 +++++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 84f26f3..775a544 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,16 +15,18 @@ jobs: steps: - name: Checkout - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4 + uses: actions/checkout@v4 + - name: shellcheck uses: reviewdog/action-shellcheck@v1.19 + test-postgresql: name: Test pg_dump with PostgreSQL version runs-on: ${{ matrix.platform }} strategy: fail-fast: false 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] services: postgres: @@ -44,12 +46,14 @@ jobs: with: fetch-depth: 0 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: ./ with: database_url: "postgres://test_user:test_user_password@localhost:5432/testdb" postgresql_version: ${{ matrix.postgresql_version }} path: "backups/${{ matrix.postgresql_version }}/backup.sql" + - name: Check changes to the backup file. id: changed_backup if: matrix.platform == 'ubuntu-latest' @@ -93,6 +97,7 @@ jobs: with: 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 + - name: Run pg_dump uses: ./ with: diff --git a/action.yml b/action.yml index 95e6f6a..bd2f201 100644 --- a/action.yml +++ b/action.yml @@ -19,13 +19,17 @@ inputs: runs: using: 'composite' steps: + - name: Setup PostgreSQL + uses: tj-actions/install-postgresql@v2 + if: inputs.postgresql_version != '' + with: + postgresql-version: ${{ inputs.postgresql_version }} - run: | bash $GITHUB_ACTION_PATH/entrypoint.sh shell: bash env: # INPUT_ is not available in Composite run steps # 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_DATABASE_URL: ${{ inputs.database_url }} INPUT_OPTIONS: ${{ inputs.options }}