gen.yml 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. name: sqlc-pg-gen
  2. on:
  3. workflow_dispatch:
  4. jobs:
  5. gen:
  6. name: sqlc-pg-gen
  7. runs-on: ubuntu-22.04
  8. services:
  9. postgres:
  10. image: postgres:15.0-alpine
  11. env:
  12. POSTGRES_USER: postgres
  13. POSTGRES_PASSWORD: postgres
  14. POSTGRES_DB: postgres
  15. ports:
  16. - 5432:5432
  17. # needed because the postgres container does not provide a healthcheck
  18. options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
  19. steps:
  20. - uses: actions/checkout@v4
  21. - uses: actions/setup-go@v5
  22. with:
  23. go-version-file: go.mod
  24. check-latest: true
  25. - run: go build -o sqlc-pg-gen ./internal/tools/sqlc-pg-gen
  26. - run: mkdir -p gen/contrib
  27. - run: ./sqlc-pg-gen gen
  28. env:
  29. PG_USER: postgres
  30. PG_HOST: localhost
  31. PG_DATABASE: postgres
  32. PG_PASSWORD: postgres
  33. PG_PORT: ${{ job.services.postgres.ports['5432'] }}
  34. - name: Save results
  35. uses: actions/upload-artifact@v4
  36. with:
  37. name: sqlc-pg-gen-results
  38. path: gen