Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: SchemaSpy shared workflow #102

Merged
merged 22 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions .github/workflows/.schema-spy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: .Schema-Spy

on:
workflow_call:
inputs:
### Typical / recommended
flyway_args:
description: 'Flyway arguments'
default: 'info migrate info'
required: false
type: string
flyway_locations:
description: 'Flyway migrations location'
default: 'filesystem:./migrations'
required: false
type: string
flyway_schema:
description: 'Flyway default schema'
default: 'users'
required: false
type: string
schemaspy_schema:
description: 'SchemaSpy default schema'
default: 'users'
required: false
type: string

jobs:
schemaspy:
name: Generate Documentation
runs-on: ubuntu-24.04
services:
postgres:
image: postgis/postgis:16-3.4
env:
POSTGRES_DB: default
POSTGRES_USER: postgres
POSTGRES_PASSWORD: default
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
timeout-minutes: 10
steps:
- uses: actions/checkout@v4

- name: Flyway
uses: docker://flyway/flyway:10
env:
FLYWAY_URL: jdbc:postgresql://postgres:5432/default
FLYWAY_USER: postgres
FLYWAY_PASSWORD: default
FLYWAY_LOCATIONS: ${{ inputs.flyway_locations }}
FLYWAY_DEFAULT_SCHEMA: ${{ inputs.flyway_schema }}
with:
args: ${{ inputs.flyway_args }}

- name: Create Output Folder
run: |
mkdir -p output/schema
chmod a+rwx -R output

- name: Run Schemaspy
run: docker run --network host -v "$PWD/output:/output" schemaspy/schemaspy:6.2.4 -t pgsql11 -db default -host 127.0.0.1 -port 5432 -u postgres -p default -schemas ${{ inputs.schemaspy_schema }}

- name: Deploy to Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: output
14 changes: 5 additions & 9 deletions .github/workflows/pr-open.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,9 @@ concurrency:
cancel-in-progress: true

jobs:
testing:
name: Testing
uses: ./.github/workflows/.pr-close.yml
with:
remove_pvc: |
frontend,
backend
schema-spy:
name: Schema Spy
uses: ./.github/workflows/.schema-spy.yml

validate:
name: Validate
Expand Down Expand Up @@ -52,15 +48,15 @@ jobs:

deploys:
name: Deploys
needs: [builds, validate]
needs: [builds]
uses: ./.github/workflows/.deployer.yml
secrets:
oc_namespace: ${{ secrets.oc_namespace }}
oc_token: ${{ secrets.oc_token }}

results:
name: Results
needs: [deploys]
needs: [deploys, schema-spy, validate]
runs-on: ubuntu-24.04
steps:
- if: needs.deploys.outputs.triggered == 'true'
Expand Down
Loading