File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -57,16 +57,28 @@ runs:
5757 sudo make install # Use sudo to install globally
5858 cd ${{ github.action_path }} # Return to action directory
5959
60- - name : Start PostgreSQL
60+ - name : Cache postgresql-client
61+ uses : actions/cache@v4
62+ id : pg-client-cache
63+ with :
64+ path : /usr/lib/postgresql
65+ key : pg-client-${{ runner.os }}-18
66+
67+ - name : Install postgresql-client
6168 shell : bash
69+ if : steps.pg-client-cache.outputs.cache-hit != 'true'
6270 run : |
63- PORT=$(shuf -i 10000-65000 -n 1)
64- echo "PG_PORT=$PORT" >> $GITHUB_ENV
6571 sudo apt-get install -y curl ca-certificates
6672 curl -fsSL https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo gpg --dearmor -o /usr/share/keyrings/postgresql.gpg
6773 echo "deb [signed-by=/usr/share/keyrings/postgresql.gpg] https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" | sudo tee /etc/apt/sources.list.d/pgdg.list
6874 sudo apt-get update
6975 sudo apt-get install -y postgresql-client-18 || sudo apt-get install -y postgresql-client-17
76+
77+ - name : Start PostgreSQL
78+ shell : bash
79+ run : |
80+ PORT=$(shuf -i 10000-65000 -n 1)
81+ echo "PG_PORT=$PORT" >> $GITHUB_ENV
7082 PG_CLIENT_VERSION=$(ls /usr/lib/postgresql | sort -rn | head -1)
7183 echo "PG_DUMP_BINARY=/usr/lib/postgresql/${PG_CLIENT_VERSION}/bin/pg_dump" >> $GITHUB_ENV
7284 echo "PG_RESTORE_BINARY=/usr/lib/postgresql/${PG_CLIENT_VERSION}/bin/pg_restore" >> $GITHUB_ENV
You can’t perform that action at this time.
0 commit comments