-
Notifications
You must be signed in to change notification settings - Fork 3
132 lines (122 loc) · 4.37 KB
/
Copy pathsync-dsl.yml
File metadata and controls
132 lines (122 loc) · 4.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
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@v4
with:
name: dsl-${{ matrix.sdk }}
path: plugins/swagger-contract-testing/skills/pactflow/references/
commit:
name: Commit updated DSLs
needs: generate
if: ${{ !cancelled() }}
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Download generated DSL files
uses: actions/download-artifact@v4
with:
pattern: dsl-*
merge-multiple: true
path: plugins/swagger-contract-testing/skills/pactflow/references/
- name: Commit and push if changed
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add plugins/swagger-contract-testing/skills/pactflow/references/
if ! git diff --staged --quiet; then
git commit -m "chore: regenerate DSL references"
git push
fi