diff --git a/.github/workflows/.schema-spy.yml b/.github/workflows/.schema-spy.yml new file mode 100644 index 0000000..d3ec241 --- /dev/null +++ b/.github/workflows/.schema-spy.yml @@ -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 diff --git a/.github/workflows/pr-open.yml b/.github/workflows/pr-open.yml index 4152575..e9d381f 100644 --- a/.github/workflows/pr-open.yml +++ b/.github/workflows/pr-open.yml @@ -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 @@ -52,7 +48,7 @@ jobs: deploys: name: Deploys - needs: [builds, validate] + needs: [builds] uses: ./.github/workflows/.deployer.yml secrets: oc_namespace: ${{ secrets.oc_namespace }} @@ -60,7 +56,7 @@ jobs: results: name: Results - needs: [deploys] + needs: [deploys, schema-spy, validate] runs-on: ubuntu-24.04 steps: - if: needs.deploys.outputs.triggered == 'true'