Bump github.com/go-playground/validator/v10 from 10.22.1 to 10.23.0 #552
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: PostgreSQL | |
on: | |
push: | |
branches: [main] | |
paths-ignore: | |
- '**.md' | |
pull_request: | |
branches: [main] | |
paths-ignore: | |
- '**.md' | |
jobs: | |
ci: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup Go env | |
uses: actions/setup-go@v5 | |
with: | |
go-version: "^1.23.0" | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 2 | |
- name: Build binary | |
run: make build | |
working-directory: cmd/warrant | |
- name: Start & configure postgres | |
run: | | |
sudo systemctl start postgresql.service | |
pg_isready | |
sudo -u postgres psql --command="CREATE USER warrant_user PASSWORD 'db_password'" | |
sudo -u postgres psql --command="ALTER USER warrant_user CREATEDB" --command="\du" | |
sudo -u postgres createdb --owner=warrant_user warrant_user | |
sudo -u postgres createdb --owner=warrant_user warrant | |
sudo -u postgres psql --command="\l" | |
- name: Install apirunner & go-migrate | |
run: | | |
go install github.com/warrant-dev/apirunner/cmd/apirunner@latest | |
go install -tags 'postgres' github.com/golang-migrate/migrate/v4/cmd/migrate@latest | |
- name: Run datastore migrations 'up' | |
run: migrate -path ./migrations/datastore/postgres/ -database postgres://warrant_user:db_password@/warrant?sslmode=disable up | |
- name: Start test server | |
id: start-server | |
run: ./cmd/warrant/bin/warrant > server.log 2>&1 & | |
env: | |
WARRANT_AUTOMIGRATE: false | |
WARRANT_PORT: 8000 | |
WARRANT_LOGLEVEL: 0 | |
WARRANT_ENABLEACCESSLOG: true | |
WARRANT_AUTHENTICATION_APIKEY: warrant_api_key | |
WARRANT_CHECK_CONCURRENCY: 4 | |
WARRANT_CHECK_MAXCONCURRENCY: 1000 | |
WARRANT_CHECK_TIMEOUT: 1m | |
WARRANT_DATASTORE: postgres | |
WARRANT_DATASTORE_POSTGRES_DSN: postgresql://warrant_user:db_password@localhost:5432/warrant?sslmode=disable | |
WARRANT_DATASTORE_POSTGRES_MAXIDLECONNECTIONS: 5 | |
WARRANT_DATASTORE_POSTGRES_MAXOPENCONNECTIONS: 5 | |
WARRANT_DATASTORE_POSTGRES_CONNMAXIDLETIME: 4h | |
WARRANT_DATASTORE_POSTGRES_CONNMAXLIFETIME: 6h | |
WARRANT_DATASTORE_POSTGRES_READERDSN: postgresql://warrant_user:db_password@localhost:5432/warrant?sslmode=disable | |
WARRANT_DATASTORE_POSTGRES_READERMAXIDLECONNECTIONS: 5 | |
WARRANT_DATASTORE_POSTGRES_READERMAXOPENCONNECTIONS: 5 | |
- name: Run apirunner tests | |
run: | | |
sleep 3 | |
apirunner tests/ '.*' tests/ci-apirunner.conf | |
- name: Shutdown test server | |
if: success() || (failure() && steps.start-server.outcome == 'success') | |
run: kill -9 `lsof -i:8000 -t` | |
- name: Run datastore migrations 'down' | |
run: echo 'y' | migrate -path ./migrations/datastore/postgres/ -database postgres://warrant_user:db_password@/warrant?sslmode=disable down | |
- name: Archive server log | |
if: failure() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: server-log | |
path: server.log | |
if-no-files-found: warn | |
retention-days: 5 |