From 651a095266c7d3238a480102c63e5148550499c0 Mon Sep 17 00:00:00 2001 From: Ruben Hoenle Date: Tue, 28 Apr 2026 10:39:27 +0200 Subject: [PATCH] fix(ci): install go sdk dependencies before linting --- .github/actions/build/go/action.yaml | 16 ---- .github/actions/build/python/action.yaml | 12 --- .github/actions/generate-sdk/go/action.yaml | 15 ---- .../actions/generate-sdk/python/action.yaml | 15 ---- .github/workflows/ci.yaml | 90 ++++++++++++++----- .github/workflows/sdk-pr.yaml | 50 +++++++++-- 6 files changed, 109 insertions(+), 89 deletions(-) delete mode 100644 .github/actions/build/go/action.yaml delete mode 100644 .github/actions/build/python/action.yaml delete mode 100644 .github/actions/generate-sdk/go/action.yaml delete mode 100644 .github/actions/generate-sdk/python/action.yaml diff --git a/.github/actions/build/go/action.yaml b/.github/actions/build/go/action.yaml deleted file mode 100644 index 26eaccf8..00000000 --- a/.github/actions/build/go/action.yaml +++ /dev/null @@ -1,16 +0,0 @@ -name: Build -description: "Build tools" -inputs: - go-version: - description: "Go version to install" - required: true -runs: - using: "composite" - steps: - - name: Install Go ${{ inputs.go-version }} - uses: actions/setup-go@v5 - with: - go-version: ${{ inputs.go-version }} - - name: Install project tools and dependencies - shell: bash - run: make project-tools diff --git a/.github/actions/build/python/action.yaml b/.github/actions/build/python/action.yaml deleted file mode 100644 index f3d74e27..00000000 --- a/.github/actions/build/python/action.yaml +++ /dev/null @@ -1,12 +0,0 @@ -name: Build -description: "Build tools" -runs: - using: "composite" - steps: - - name: Install project tools and dependencies - shell: bash - run: | - python -m venv .venv - . .venv/bin/activate - python -m pip install --upgrade pip - make project-tools LANGUAGE=python diff --git a/.github/actions/generate-sdk/go/action.yaml b/.github/actions/generate-sdk/go/action.yaml deleted file mode 100644 index 84d3ad68..00000000 --- a/.github/actions/generate-sdk/go/action.yaml +++ /dev/null @@ -1,15 +0,0 @@ -name: Generate SDK -description: "Generates the SDK" -inputs: - go-version: - description: "Go version to install" - required: true -runs: - using: "composite" - steps: - - name: Download OAS - shell: bash - run: make download-oas - - name: Generate SDK - shell: bash - run: make generate-sdk \ No newline at end of file diff --git a/.github/actions/generate-sdk/python/action.yaml b/.github/actions/generate-sdk/python/action.yaml deleted file mode 100644 index 8a293b60..00000000 --- a/.github/actions/generate-sdk/python/action.yaml +++ /dev/null @@ -1,15 +0,0 @@ -name: Generate SDK -description: "Generates the Python SDK" -inputs: - python-version: - description: "Python version to install" - required: true -runs: - using: "composite" - steps: - - name: Download OAS - shell: bash - run: make download-oas - - name: Generate SDK - shell: bash - run: make generate-sdk LANGUAGE=python \ No newline at end of file diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 5b59abce..9a15f039 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -3,7 +3,7 @@ name: CI Workflow on: [pull_request, workflow_dispatch] env: - GO_VERSION_BUILD: "1.22" + GO_VERSION_BUILD: "1.25" JAVA_VERSION: "11" jobs: @@ -20,18 +20,27 @@ jobs: with: distribution: "temurin" java-version: ${{ env.JAVA_VERSION }} + - name: Checkout uses: actions/checkout@v4 - - name: Build - uses: ./.github/actions/build/go - with: - go-version: ${{ env.GO_VERSION_BUILD }} - - name: Generate SDK - uses: ./.github/actions/generate-sdk/go - - name: Install Go ${{ matrix.go-version }} + + - name: Install Go uses: actions/setup-go@v5 with: go-version: ${{ matrix.go-version }} + + - name: Install project tools and dependencies + shell: bash + run: make project-tools + + - name: Download OAS + shell: bash + run: make download-oas + + - name: Generate SDK + shell: bash + run: make generate-go-sdk + - name: Test working-directory: ./sdk-repo-updated run: make test skip-non-generated-files=true @@ -48,21 +57,35 @@ jobs: with: distribution: "temurin" java-version: ${{ env.JAVA_VERSION }} + - name: Checkout uses: actions/checkout@v4 - - name: Build - uses: ./.github/actions/build/go - with: - go-version: ${{ env.GO_VERSION_BUILD }} - - name: Generate SDK - uses: ./.github/actions/generate-sdk/go - - name: Install Go ${{ env.GO_VERSION_BUILD }} + + - name: Install Go uses: actions/setup-go@v5 with: go-version: ${{ env.GO_VERSION_BUILD }} + + - name: Install project tools and dependencies + shell: bash + run: make project-tools + + - name: Download OAS + shell: bash + run: make download-oas + + - name: Generate SDK + shell: bash + run: make generate-go-sdk + - name: Remove waiters working-directory: ./sdk-repo-updated run: rm -r services/*/wait + + - name: Install SDK project tools and dependencies + working-directory: ./sdk-repo-updated + run: make project-tools + - name: Lint working-directory: ./sdk-repo-updated run: make lint skip-non-generated-files=true @@ -80,29 +103,45 @@ jobs: with: distribution: "temurin" java-version: ${{ env.JAVA_VERSION }} + - name: Checkout uses: actions/checkout@v4 + - name: install uv uses: astral-sh/setup-uv@v7 with: version: "0.10.4" - - name: Build - uses: ./.github/actions/build/python + + - name: Install project tools and dependencies + shell: bash + run: | + python -m venv .venv + . .venv/bin/activate + python -m pip install --upgrade pip + make project-tools LANGUAGE=python + + - name: Download OAS + shell: bash + run: make download-oas + - name: Generate SDK - uses: ./.github/actions/generate-sdk/python - with: - python-version: ${{ matrix.python-version }} + shell: bash + run: make generate-python-sdk + - name: install uv uses: astral-sh/setup-uv@v7 with: version: "0.10.4" python-version: ${{ matrix.python-version }} - - name: Install sdk + + - name: Install SDK working-directory: ./sdk-repo-updated run: make install-dev + - name: Lint working-directory: ./sdk-repo-updated run: make lint + - name: Test working-directory: ./sdk-repo-updated run: make test @@ -119,17 +158,20 @@ jobs: with: distribution: "temurin" java-version: ${{ matrix.java-version }} + - name: Checkout uses: actions/checkout@v5 + - name: Download OAS run: make download-oas + - name: Generate SDK - run: make generate-sdk - env: - LANGUAGE: java + run: make generate-java-sdk + - name: Lint working-directory: ./sdk-repo-updated run: make lint + - name: Test working-directory: ./sdk-repo-updated run: make test diff --git a/.github/workflows/sdk-pr.yaml b/.github/workflows/sdk-pr.yaml index 82e545bb..4819c2ea 100644 --- a/.github/workflows/sdk-pr.yaml +++ b/.github/workflows/sdk-pr.yaml @@ -7,7 +7,7 @@ on: workflow_dispatch: env: - GO_VERSION: "1.22" + GO_VERSION: "1.25" JAVA_VERSION: "25" jobs: @@ -23,25 +23,40 @@ jobs: with: key: ${{ secrets.SSH_PRIVATE_KEY }} known_hosts: ${{ vars.SSH_KNOWN_HOSTS }} + - name: Install Java uses: actions/setup-java@v4 with: distribution: "temurin" java-version: ${{ env.JAVA_VERSION }} + - name: Checkout uses: actions/checkout@v4 - - name: Build - uses: ./.github/actions/build/go + + - name: Install Go + uses: actions/setup-go@v5 with: go-version: ${{ env.GO_VERSION }} + + - name: Install project tools and dependencies + shell: bash + run: make project-tools + + - name: Download OAS + shell: bash + run: make download-oas + - name: Generate SDK - uses: ./.github/actions/generate-sdk/go + shell: bash + run: make generate-sdk + - name: Push SDK env: GH_REPO: "stackitcloud/stackit-sdk-go" GH_TOKEN: ${{ secrets.SDK_PR_TOKEN }} run: | 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 }})" + main-python: name: "[Python] Update SDK Repo" runs-on: ubuntu-latest @@ -54,21 +69,37 @@ jobs: with: key: ${{ secrets.SSH_PRIVATE_KEY }} known_hosts: ${{ vars.SSH_KNOWN_HOSTS }} + - name: Install Java uses: actions/setup-java@v4 with: distribution: "temurin" java-version: ${{ env.JAVA_VERSION }} + - name: Checkout uses: actions/checkout@v4 - - name: Build - uses: ./.github/actions/build/python + + - name: Install project tools and dependencies + shell: bash + run: | + python -m venv .venv + . .venv/bin/activate + python -m pip install --upgrade pip + make project-tools LANGUAGE=python + - name: install uv uses: astral-sh/setup-uv@v7 with: version: "0.10.4" + + - name: Download OAS + shell: bash + run: make download-oas + - name: Generate SDK - uses: ./.github/actions/generate-sdk/python + shell: bash + run: make generate-sdk LANGUAGE=python + - name: Push SDK env: GH_REPO: "stackitcloud/stackit-sdk-python" @@ -89,19 +120,24 @@ jobs: with: key: ${{ secrets.SSH_PRIVATE_KEY }} known_hosts: ${{ vars.SSH_KNOWN_HOSTS }} + - name: Install Java uses: actions/setup-java@v4 with: distribution: "temurin" java-version: ${{ env.JAVA_VERSION }} + - name: Checkout uses: actions/checkout@v5 + - name: Download OAS run: make download-oas + - name: Generate SDK run: make generate-sdk env: LANGUAGE: java + - name: Push SDK env: GH_REPO: "stackitcloud/stackit-sdk-java"