Skip to content

fix(deps): Update module github.com/cloudquery/plugin-sdk/v4 to v4.59… #3

fix(deps): Update module github.com/cloudquery/plugin-sdk/v4 to v4.59…

fix(deps): Update module github.com/cloudquery/plugin-sdk/v4 to v4.59… #3

name: Destination Plugin Postgresql Workflow
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
pull_request:
paths:
- "plugins/destination/postgresql/**"
- ".github/workflows/dest_postgresql.yml"
push:
branches:
- main
paths:
- "plugins/destination/postgresql/**"
- ".github/workflows/dest_postgresql.yml"
jobs:
plugins-destination-postgresql:
timeout-minutes: 30
name: "plugins/destination/postgresql"
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./plugins/destination/postgresql
services:
# Label used to access the service container
postgres:
image: postgres:10
env:
POSTGRES_PASSWORD: pass
POSTGRES_USER: postgres
POSTGRES_DB: postgres
ports:
- 5432:5432
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Set up Go 1.x
uses: actions/setup-go@v5
with:
go-version-file: plugins/destination/postgresql/go.mod
cache: true
cache-dependency-path: plugins/destination/postgresql/go.sum
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.55.2
working-directory: plugins/destination/postgresql
args: "--config ../../.golangci.yml"
- name: gen
if: github.event_name == 'pull_request'
run: make gen
- name: Fail if generation updated files
if: github.event_name == 'pull_request'
run: test "$(git status -s | wc -l)" -eq 0 || (git status -s; exit 1)
- name: Build
run: go build .
- name: Test PG
run: make test
# cockroachdb doesn't support services right now
# https://stackoverflow.com/questions/73648218/github-action-setup-secure-cockroachdb
- name: Spin up CockroachDB
run: |
docker run -d -p 26257:26257 cockroachdb/cockroach:v22.1.8 start-single-node --insecure
sudo apt update && sudo apt install wait-for-it -y
wait-for-it -h localhost -p 26257
- name: Test CockroachDB
run: CQ_DEST_PG_TEST_CONN="postgresql://root@localhost:26257/postgres?sslmode=disable" make test
validate-config-ui:
timeout-minutes: 15
if: github.event_name == 'pull_request'
permissions:
id-token: write
contents: read
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./plugins/destination/postgresql
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Set up Go 1.x
uses: actions/setup-go@v5
with:
go-version-file: plugins/destination/postgresql/go.mod
cache: true
cache-dependency-path: plugins/destination/postgresql/go.sum
- name: Gen
run: make gen
- name: Build
run: go build .
- name: Use Node.js LTS
uses: actions/setup-node@v4
with:
node-version: "lts/*"
cache: "npm"
cache-dependency-path: "plugins/destination/postgresql/cloud-config-ui/package-lock.json"
- name: Install dependencies
working-directory: "plugins/destination/postgresql/cloud-config-ui"
run: npm ci
- name: Install dotenv
run: npm install dotenv-cli -g
- name: Install Playwright
working-directory: "plugins/destination/postgresql/cloud-config-ui"
run: npx playwright install --with-deps
- name: Build config UI
working-directory: "plugins/destination/postgresql/cloud-config-ui"
run: REACT_APP_USE_CLOUD_APP_MOCK=true npm run build
- name: Run E2E tests and generate configs
working-directory: "plugins/destination/postgresql/cloud-config-ui"
run: E2E_TESTS_GENERATE_CONFIG=true npm run test:e2e
- name: Setup CloudQuery
uses: cloudquery/setup-cloudquery@v3
with:
version: v6.3.0
- name: Validate CloudQuery config
working-directory: "plugins/destination/postgresql/cloud-config-ui"
run: dotenv -e ./temp/.env -- cloudquery validate-config ./temp/config.yml
env:
CLOUDQUERY_API_KEY: ${{ secrets.CLOUDQUERY_API_KEY }}