https://github.com/adjust/pg-ext-actions
Github action to build and test PostgreSQL extensions
https://github.com/adjust/pg-ext-actions
Last synced: 23 days ago
JSON representation
Github action to build and test PostgreSQL extensions
- Host: GitHub
- URL: https://github.com/adjust/pg-ext-actions
- Owner: adjust
- Created: 2021-10-22T09:40:41.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-10-27T10:37:05.000Z (over 4 years ago)
- Last Synced: 2025-12-15T01:14:05.583Z (6 months ago)
- Language: Shell
- Size: 4.88 KB
- Stars: 2
- Watchers: 6
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# pg-ext-actions
A custom Github actions for testing PostgreSQL extensions.
## Actions
### `pg-setup`
Install and run specified PostgreSQL version.
Arguments:
* `version`: major PostgreSQL version, required;
* `install-contrib`: whether to install postgres-contrib package; `'true'` for yes, anything else is considered a no, optional.
### `install-dependency`
Clone, build and install listed PostgreSQL extensions.
Arguments:
* `repository`: a space separated list of repositories of extensions to be installed, required;
* `host`: git platform hostname, optional; GitHub (github.com) is used by default;
* `auth-token`: authentication token (e.g. GitHub personal access token), optional.
### `build-check`
Build and install extension and run regression tests. In case of test failure the `regression.diff` is printed out and error code is returned.
Arguments:
* `working-directory`: directory to run script in, optional; by default runs script in current directory.
### `update-check`
Run update script from the version specified in control file in the main branch (e.g. `master` or `main`) to the current version.
Arguments:
* `main-branch`: main branch to update from, optional; when not specified the default branch is used;
* `working-directory`: directory to run script in, optional; by default runs script in current directory.
## Example for Github Actions
```yaml
name: CI
on:
push:
branches: ['*']
pull_request:
branches: ['*']
jobs:
test:
strategy:
fail-fast: false
matrix:
pg: [14, 13, 12, 11, 10, 9.6]
name: PostgreSQL ${{ matrix.pg }}
runs-on: ubuntu-latest
steps:
# Install PostgreSQL
- uses: adjust/pg-ext-actions/pg-setup@master
with:
version: ${{ matrix.pg }}
install-contrib: 'true'
# Install dependencies
- uses: adjust/pg-ext-actions/install-dependency@master
with:
repository: /
auth-token: ${{ secrets.SECRET_TOKEN }}
# Clone and build extension, run tests
- uses: actions/checkout@v2
- uses: adjust/pg-ext-actions/build-check@master
```