Sensible default quota and storage systems when MySQL support unavail… #83
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Test PostgreSQL | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
workflow_dispatch: | |
permissions: | |
contents: read | |
jobs: | |
lint: | |
permissions: | |
contents: read # for actions/checkout to fetch code | |
pull-requests: read # for golangci/golangci-lint-action to fetch pull requests | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0 | |
with: | |
go-version-file: go.mod | |
check-latest: true | |
cache: true | |
- uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6.1.1 | |
with: | |
version: 'v1.55.1' | |
args: ./storage/postgresql | |
integration-and-unit-tests: | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres | |
env: | |
POSTGRES_HOST_AUTH_METHOD: trust | |
options: >- | |
--name pgsql | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
- 5432:5432 | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0 | |
with: | |
go-version-file: go.mod | |
check-latest: true | |
cache: true | |
- name: Build before tests | |
run: go mod download && go build ./... | |
- name: Run integration tests | |
run: ./integration/integration_test.sh | |
env: | |
TEST_POSTGRESQL_URI: postgresql:///defaultdb?host=localhost&user=postgres&password=postgres | |
POSTGRESQL_IN_CONTAINER: true | |
POSTGRESQL_CONTAINER_NAME: pgsql | |
- name: Run unit tests | |
run: go test -v ./storage/postgresql/... ./quota/postgresqlqm/... | |