Skip to content

Commit 23d941f

Browse files
authored
fix(ci): install go sdk dependencies before linting (#262)
1 parent 9341e4b commit 23d941f

6 files changed

Lines changed: 109 additions & 89 deletions

File tree

.github/actions/build/go/action.yaml

Lines changed: 0 additions & 16 deletions
This file was deleted.

.github/actions/build/python/action.yaml

Lines changed: 0 additions & 12 deletions
This file was deleted.

.github/actions/generate-sdk/go/action.yaml

Lines changed: 0 additions & 15 deletions
This file was deleted.

.github/actions/generate-sdk/python/action.yaml

Lines changed: 0 additions & 15 deletions
This file was deleted.

.github/workflows/ci.yaml

Lines changed: 66 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: CI Workflow
33
on: [pull_request, workflow_dispatch]
44

55
env:
6-
GO_VERSION_BUILD: "1.22"
6+
GO_VERSION_BUILD: "1.25"
77
JAVA_VERSION: "11"
88

99
jobs:
@@ -20,18 +20,27 @@ jobs:
2020
with:
2121
distribution: "temurin"
2222
java-version: ${{ env.JAVA_VERSION }}
23+
2324
- name: Checkout
2425
uses: actions/checkout@v4
25-
- name: Build
26-
uses: ./.github/actions/build/go
27-
with:
28-
go-version: ${{ env.GO_VERSION_BUILD }}
29-
- name: Generate SDK
30-
uses: ./.github/actions/generate-sdk/go
31-
- name: Install Go ${{ matrix.go-version }}
26+
27+
- name: Install Go
3228
uses: actions/setup-go@v5
3329
with:
3430
go-version: ${{ matrix.go-version }}
31+
32+
- name: Install project tools and dependencies
33+
shell: bash
34+
run: make project-tools
35+
36+
- name: Download OAS
37+
shell: bash
38+
run: make download-oas
39+
40+
- name: Generate SDK
41+
shell: bash
42+
run: make generate-go-sdk
43+
3544
- name: Test
3645
working-directory: ./sdk-repo-updated
3746
run: make test skip-non-generated-files=true
@@ -48,21 +57,35 @@ jobs:
4857
with:
4958
distribution: "temurin"
5059
java-version: ${{ env.JAVA_VERSION }}
60+
5161
- name: Checkout
5262
uses: actions/checkout@v4
53-
- name: Build
54-
uses: ./.github/actions/build/go
55-
with:
56-
go-version: ${{ env.GO_VERSION_BUILD }}
57-
- name: Generate SDK
58-
uses: ./.github/actions/generate-sdk/go
59-
- name: Install Go ${{ env.GO_VERSION_BUILD }}
63+
64+
- name: Install Go
6065
uses: actions/setup-go@v5
6166
with:
6267
go-version: ${{ env.GO_VERSION_BUILD }}
68+
69+
- name: Install project tools and dependencies
70+
shell: bash
71+
run: make project-tools
72+
73+
- name: Download OAS
74+
shell: bash
75+
run: make download-oas
76+
77+
- name: Generate SDK
78+
shell: bash
79+
run: make generate-go-sdk
80+
6381
- name: Remove waiters
6482
working-directory: ./sdk-repo-updated
6583
run: rm -r services/*/wait
84+
85+
- name: Install SDK project tools and dependencies
86+
working-directory: ./sdk-repo-updated
87+
run: make project-tools
88+
6689
- name: Lint
6790
working-directory: ./sdk-repo-updated
6891
run: make lint skip-non-generated-files=true
@@ -80,29 +103,45 @@ jobs:
80103
with:
81104
distribution: "temurin"
82105
java-version: ${{ env.JAVA_VERSION }}
106+
83107
- name: Checkout
84108
uses: actions/checkout@v4
109+
85110
- name: install uv
86111
uses: astral-sh/setup-uv@v7
87112
with:
88113
version: "0.10.4"
89-
- name: Build
90-
uses: ./.github/actions/build/python
114+
115+
- name: Install project tools and dependencies
116+
shell: bash
117+
run: |
118+
python -m venv .venv
119+
. .venv/bin/activate
120+
python -m pip install --upgrade pip
121+
make project-tools LANGUAGE=python
122+
123+
- name: Download OAS
124+
shell: bash
125+
run: make download-oas
126+
91127
- name: Generate SDK
92-
uses: ./.github/actions/generate-sdk/python
93-
with:
94-
python-version: ${{ matrix.python-version }}
128+
shell: bash
129+
run: make generate-python-sdk
130+
95131
- name: install uv
96132
uses: astral-sh/setup-uv@v7
97133
with:
98134
version: "0.10.4"
99135
python-version: ${{ matrix.python-version }}
100-
- name: Install sdk
136+
137+
- name: Install SDK
101138
working-directory: ./sdk-repo-updated
102139
run: make install-dev
140+
103141
- name: Lint
104142
working-directory: ./sdk-repo-updated
105143
run: make lint
144+
106145
- name: Test
107146
working-directory: ./sdk-repo-updated
108147
run: make test
@@ -119,17 +158,20 @@ jobs:
119158
with:
120159
distribution: "temurin"
121160
java-version: ${{ matrix.java-version }}
161+
122162
- name: Checkout
123163
uses: actions/checkout@v5
164+
124165
- name: Download OAS
125166
run: make download-oas
167+
126168
- name: Generate SDK
127-
run: make generate-sdk
128-
env:
129-
LANGUAGE: java
169+
run: make generate-java-sdk
170+
130171
- name: Lint
131172
working-directory: ./sdk-repo-updated
132173
run: make lint
174+
133175
- name: Test
134176
working-directory: ./sdk-repo-updated
135177
run: make test

.github/workflows/sdk-pr.yaml

Lines changed: 43 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
workflow_dispatch:
88

99
env:
10-
GO_VERSION: "1.22"
10+
GO_VERSION: "1.25"
1111
JAVA_VERSION: "25"
1212

1313
jobs:
@@ -23,25 +23,40 @@ jobs:
2323
with:
2424
key: ${{ secrets.SSH_PRIVATE_KEY }}
2525
known_hosts: ${{ vars.SSH_KNOWN_HOSTS }}
26+
2627
- name: Install Java
2728
uses: actions/setup-java@v4
2829
with:
2930
distribution: "temurin"
3031
java-version: ${{ env.JAVA_VERSION }}
32+
3133
- name: Checkout
3234
uses: actions/checkout@v4
33-
- name: Build
34-
uses: ./.github/actions/build/go
35+
36+
- name: Install Go
37+
uses: actions/setup-go@v5
3538
with:
3639
go-version: ${{ env.GO_VERSION }}
40+
41+
- name: Install project tools and dependencies
42+
shell: bash
43+
run: make project-tools
44+
45+
- name: Download OAS
46+
shell: bash
47+
run: make download-oas
48+
3749
- name: Generate SDK
38-
uses: ./.github/actions/generate-sdk/go
50+
shell: bash
51+
run: make generate-sdk
52+
3953
- name: Push SDK
4054
env:
4155
GH_REPO: "stackitcloud/stackit-sdk-go"
4256
GH_TOKEN: ${{ secrets.SDK_PR_TOKEN }}
4357
run: |
4458
scripts/sdk-create-pr.sh "generator-bot-${{ github.run_id }}" "Generated from GitHub run [${{ github.run_id }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})"
59+
4560
main-python:
4661
name: "[Python] Update SDK Repo"
4762
runs-on: ubuntu-latest
@@ -54,21 +69,37 @@ jobs:
5469
with:
5570
key: ${{ secrets.SSH_PRIVATE_KEY }}
5671
known_hosts: ${{ vars.SSH_KNOWN_HOSTS }}
72+
5773
- name: Install Java
5874
uses: actions/setup-java@v4
5975
with:
6076
distribution: "temurin"
6177
java-version: ${{ env.JAVA_VERSION }}
78+
6279
- name: Checkout
6380
uses: actions/checkout@v4
64-
- name: Build
65-
uses: ./.github/actions/build/python
81+
82+
- name: Install project tools and dependencies
83+
shell: bash
84+
run: |
85+
python -m venv .venv
86+
. .venv/bin/activate
87+
python -m pip install --upgrade pip
88+
make project-tools LANGUAGE=python
89+
6690
- name: install uv
6791
uses: astral-sh/setup-uv@v7
6892
with:
6993
version: "0.10.4"
94+
95+
- name: Download OAS
96+
shell: bash
97+
run: make download-oas
98+
7099
- name: Generate SDK
71-
uses: ./.github/actions/generate-sdk/python
100+
shell: bash
101+
run: make generate-sdk LANGUAGE=python
102+
72103
- name: Push SDK
73104
env:
74105
GH_REPO: "stackitcloud/stackit-sdk-python"
@@ -89,19 +120,24 @@ jobs:
89120
with:
90121
key: ${{ secrets.SSH_PRIVATE_KEY }}
91122
known_hosts: ${{ vars.SSH_KNOWN_HOSTS }}
123+
92124
- name: Install Java
93125
uses: actions/setup-java@v4
94126
with:
95127
distribution: "temurin"
96128
java-version: ${{ env.JAVA_VERSION }}
129+
97130
- name: Checkout
98131
uses: actions/checkout@v5
132+
99133
- name: Download OAS
100134
run: make download-oas
135+
101136
- name: Generate SDK
102137
run: make generate-sdk
103138
env:
104139
LANGUAGE: java
140+
105141
- name: Push SDK
106142
env:
107143
GH_REPO: "stackitcloud/stackit-sdk-java"

0 commit comments

Comments
 (0)