Skip to content

RA-8661: Merge upstream updates from Google (RA-8661 → RA-8279) #39

RA-8661: Merge upstream updates from Google (RA-8661 → RA-8279)

RA-8661: Merge upstream updates from Google (RA-8661 → RA-8279) #39

Workflow file for this run

---
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@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
with:
go-version-file: go.mod
check-latest: true
cache: true
- name: Generate token
id: generate_token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.CT_APP_ID }}
private-key: ${{ secrets.CT_APP_PRIVATE_KEY }}
owner: digicert
repositories: ctutils
- name: Authenticate with private ctutils
run: |
git config --global url."https://x-access-token:${{ steps.generate_token.outputs.token }}@github.com/".insteadOf "https://github.com/"
- uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0
with:
version: 'v2.6.0'
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@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
with:
go-version-file: go.mod
check-latest: true
cache: true
- name: Generate token
id: generate_token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.CT_APP_ID }}
private-key: ${{ secrets.CT_APP_PRIVATE_KEY }}
owner: digicert
repositories: ctutils
- name: Authenticate with private ctutils
run: |
git config --global url."https://x-access-token:${{ steps.generate_token.outputs.token }}@github.com/".insteadOf "https://github.com/"
- 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/...