Repository navigation
142 lines (127 loc) · 3.71 KB
/
Copy pathci.yml
File metadata and controls
142 lines (127 loc) · 3.71 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
133
134
135
136
137
138
139
140
141
142
name: CI
on:
pull_request:
push:
branches:
- main
permissions:
contents: read
jobs:
contract:
name: OpenAPI contract
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: 1.3.14
- name: Set up Go for contract compatibility checks
if: github.event_name == 'pull_request'
uses: actions/setup-go@v5
with:
go-version: '1.26.x'
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Lint and bundle contract
run: bun run check
- name: Check for breaking contract changes
if: github.event_name == 'pull_request'
run: |
if git cat-file -e "${{ github.event.pull_request.base.sha }}:openapi/anssl.openapi.yaml"; then
git show "${{ github.event.pull_request.base.sha }}:openapi/anssl.openapi.yaml" > "$RUNNER_TEMP/anssl.base.openapi.yaml"
go run github.com/oasdiff/oasdiff@v1.23.0 breaking "$RUNNER_TEMP/anssl.base.openapi.yaml" openapi/anssl.openapi.yaml
else
echo "No base contract exists; treating this pull request as the initial contract baseline."
fi
- name: Verify generated clients are current
env:
JAVA_OPTS: -Xms64m -Xmx512m
run: |
bun run generate
git diff --exit-code
test -z "$(git status --porcelain --untracked-files=all)"
typescript:
name: TypeScript SDK
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
with:
bun-version: 1.3.14
- run: bun install --frozen-lockfile
- run: bun run --cwd packages/typescript check
go:
name: Go SDK
runs-on: ubuntu-latest
defaults:
run:
working-directory: packages/go
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.24.x'
cache-dependency-path: packages/go/go.sum
- run: go test ./...
python:
name: Python SDK
runs-on: ubuntu-latest
defaults:
run:
working-directory: packages/python
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- run: python -m pip install --upgrade pip build
- run: python -m pip install -e '.[test]'
- run: pytest tests
- run: python -m build
java:
name: Java SDK
runs-on: ubuntu-latest
defaults:
run:
working-directory: packages/java
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '17'
cache: gradle
- run: chmod +x gradlew
- run: ./gradlew test --no-daemon --max-workers=1
php:
name: PHP SDK
runs-on: ubuntu-latest
defaults:
run:
working-directory: packages/php
steps:
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
tools: composer
coverage: none
- run: composer install --no-interaction --prefer-dist
- run: composer test
csharp:
name: C# SDK
runs-on: ubuntu-latest
defaults:
run:
working-directory: packages/csharp
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- run: dotnet test tests/Anssl.Tests/Anssl.Tests.csproj --configuration Release
- run: dotnet pack src/Anssl/Anssl.csproj --configuration Release --no-restore