Sync Pact SDK DSLs #12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Sync Pact SDK DSLs | |
| on: | |
| schedule: | |
| - cron: "0 3 * * 1" # Every Monday at 03:00 UTC | |
| workflow_dispatch: | |
| inputs: | |
| python_ref: | |
| description: "pact-python branch or tag" | |
| default: main | |
| required: false | |
| js_ref: | |
| description: "pact-js branch or tag" | |
| default: master | |
| required: false | |
| go_ref: | |
| description: "pact-go branch or tag" | |
| default: master | |
| required: false | |
| dotnet_ref: | |
| description: "pact-net branch or tag" | |
| default: master | |
| required: false | |
| php_ref: | |
| description: "pact-php branch or tag" | |
| default: master | |
| required: false | |
| jvm_ref: | |
| description: "pact-jvm branch or tag" | |
| default: master | |
| required: false | |
| swift_ref: | |
| description: "PactSwift branch or tag" | |
| default: main | |
| required: false | |
| jobs: | |
| generate: | |
| name: Generate ${{ matrix.sdk }} DSL | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - sdk: python | |
| repo: pact-python | |
| script: scripts/generate/dsl_python.py | |
| outputs: plugins/swagger-contract-testing/skills/pactflow/references/dsl.python.md | |
| ref_input: python_ref | |
| - sdk: javascript | |
| repo: pact-js | |
| script: scripts/generate/dsl_js.py | |
| outputs: >- | |
| plugins/swagger-contract-testing/skills/pactflow/references/dsl.typescript.md | |
| plugins/swagger-contract-testing/skills/pactflow/references/dsl.javascript.md | |
| ref_input: js_ref | |
| - sdk: golang | |
| repo: pact-go | |
| script: scripts/generate/dsl_go.py | |
| outputs: plugins/swagger-contract-testing/skills/pactflow/references/dsl.golang.md | |
| ref_input: go_ref | |
| - sdk: dotnet | |
| repo: pact-net | |
| script: scripts/generate/dsl_dotnet.py | |
| outputs: plugins/swagger-contract-testing/skills/pactflow/references/dsl.dotnet.md | |
| ref_input: dotnet_ref | |
| - sdk: php | |
| repo: pact-php | |
| script: scripts/generate/dsl_php.py | |
| outputs: plugins/swagger-contract-testing/skills/pactflow/references/dsl.php.md | |
| ref_input: php_ref | |
| - sdk: jvm | |
| repo: pact-jvm | |
| script: scripts/generate/dsl_jvm.py | |
| outputs: >- | |
| plugins/swagger-contract-testing/skills/pactflow/references/dsl.kotlin.md | |
| plugins/swagger-contract-testing/skills/pactflow/references/dsl.java.md | |
| ref_input: jvm_ref | |
| - sdk: swift | |
| repo: PactSwift | |
| script: scripts/generate/dsl_swift.py | |
| outputs: plugins/swagger-contract-testing/skills/pactflow/references/dsl.swift.md | |
| ref_input: swift_ref | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 | |
| - name: Generate DSL(s) for ${{ matrix.sdk }} | |
| run: | | |
| REF="${{ inputs[matrix.ref_input] }}" | |
| uv run --project scripts/generate ${{ matrix.script }} ${REF:+--ref "$REF"} | |
| - name: Format generated markdown | |
| run: | | |
| for f in ${{ matrix.outputs }}; do | |
| uvx mdformat "$f" | |
| done | |
| - name: Upload generated files | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 | |
| with: | |
| name: dsl-${{ matrix.sdk }} | |
| path: plugins/swagger-contract-testing/skills/pactflow/references/ | |
| pull-request: | |
| name: Open PR for updated DSLs | |
| needs: generate | |
| if: ${{ !cancelled() }} | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Download generated DSL files | |
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8 | |
| with: | |
| pattern: dsl-* | |
| merge-multiple: true | |
| path: plugins/swagger-contract-testing/skills/pactflow/references/ | |
| - name: Open pull request if changed | |
| uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8 | |
| with: | |
| commit-message: "chore: regenerate DSL references" | |
| branch: chore/regenerate-dsl-references | |
| delete-branch: true | |
| title: "chore: regenerate DSL references" | |
| body: | | |
| Auto-generated by the [Sync Pact SDK DSLs](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) workflow. | |
| labels: automated |