Skip to content

Make tests use postgres version from env #206

Make tests use postgres version from env

Make tests use postgres version from env #206

Workflow file for this run

name: Build
on: [push]
jobs:
test:
name: test
runs-on: ubuntu-latest
continue-on-error: true
strategy:
matrix:
pgVersion: ['14.8', '15.3']
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20.5'
- name: Run tests
run: |
echo "Using postgres version $GITHUB_REF"
go test ./... -v
env:
POSTGRES_VERSION: ${{ matrix.version }}
lint:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20.5'
cache: false
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
# Require: The version of golangci-lint to use.
# When `install-mode` is `binary` (default) the value can be v1.2 or v1.2.3 or `latest` to use the latest version.
# When `install-mode` is `goinstall` the value can be v1.2.3, `latest`, or the hash of a commit.
version: v1.53
# Optional: golangci-lint command line arguments.
#
# Note: By default, the `.golangci.yml` file should be at the root of the repository.
# The location of the configuration file can be changed by using `--config=`
args: --timeout=30m --out-format=colored-line-number --config=.golangci.yml
- name: Ensure JSON examples are formatted
run: |
for file in ./examples/*.json; do
if ! diff <(cat $file | jq) <(cat $file); then
echo "$file is not formatted: run 'cat $file | jq' to fix";
exit 1;
fi
done