From cd7e53a9de66b9865bc5e28121ec986720a14321 Mon Sep 17 00:00:00 2001 From: Vicente Pinto Date: Fri, 20 Dec 2024 09:58:00 +0000 Subject: [PATCH 1/2] Install python tools in the pipeline --- .github/actions/build/{ => go}/action.yaml | 2 +- .github/actions/build/python/action.yaml | 8 +++++++ .github/workflows/sdk-pr.yaml | 26 ++++++++++------------ 3 files changed, 21 insertions(+), 15 deletions(-) rename .github/actions/build/{ => go}/action.yaml (92%) create mode 100644 .github/actions/build/python/action.yaml diff --git a/.github/actions/build/action.yaml b/.github/actions/build/go/action.yaml similarity index 92% rename from .github/actions/build/action.yaml rename to .github/actions/build/go/action.yaml index 875c7f5..26eaccf 100644 --- a/.github/actions/build/action.yaml +++ b/.github/actions/build/go/action.yaml @@ -13,4 +13,4 @@ runs: go-version: ${{ inputs.go-version }} - name: Install project tools and dependencies shell: bash - run: make project-tools \ No newline at end of file + run: make project-tools diff --git a/.github/actions/build/python/action.yaml b/.github/actions/build/python/action.yaml new file mode 100644 index 0000000..a6e9120 --- /dev/null +++ b/.github/actions/build/python/action.yaml @@ -0,0 +1,8 @@ +name: Build +description: "Build tools" +runs: + using: "composite" + steps: + - name: Install project tools and dependencies + shell: bash + run: make project-tools LANGUAGE=python diff --git a/.github/workflows/sdk-pr.yaml b/.github/workflows/sdk-pr.yaml index 3de0c7a..5e4a225 100644 --- a/.github/workflows/sdk-pr.yaml +++ b/.github/workflows/sdk-pr.yaml @@ -7,8 +7,8 @@ on: workflow_dispatch: env: - GO_VERSION: '1.22' - JAVA_VERSION: '11' + GO_VERSION: "1.22" + JAVA_VERSION: "11" jobs: main-go: @@ -23,22 +23,22 @@ jobs: - name: Install Java uses: actions/setup-java@v4 with: - distribution: 'temurin' + distribution: "temurin" java-version: ${{ env.JAVA_VERSION }} - name: Checkout uses: actions/checkout@v4 - name: Build - uses: ./.github/actions/build + uses: ./.github/actions/build/go with: go-version: ${{ env.GO_VERSION }} - name: Generate SDK uses: ./.github/actions/generate-sdk/go - name: Push SDK - env: - GH_REPO: 'stackitcloud/stackit-sdk-go' + 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 }})" + 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 @@ -51,19 +51,17 @@ jobs: - name: Install Java uses: actions/setup-java@v4 with: - distribution: 'temurin' + distribution: "temurin" java-version: ${{ env.JAVA_VERSION }} - name: Checkout uses: actions/checkout@v4 - name: Build - uses: ./.github/actions/build - with: - go-version: ${{ env.GO_VERSION }} + uses: ./.github/actions/build/python - name: Generate SDK uses: ./.github/actions/generate-sdk/python - name: Push SDK - env: - GH_REPO: 'stackitcloud/stackit-sdk-python' + env: + GH_REPO: "stackitcloud/stackit-sdk-python" 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 }})" "git@github.com:stackitcloud/stackit-sdk-python.git" "python" + 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 }})" "git@github.com:stackitcloud/stackit-sdk-python.git" "python" From d9539ec3b031c42f9d65f8bb8e862393c2c99314 Mon Sep 17 00:00:00 2001 From: Vicente Pinto Date: Fri, 20 Dec 2024 10:00:03 +0000 Subject: [PATCH 2/2] Adjust CI pipeline --- .github/workflows/ci.yaml | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index b0d0b1c..2d2c2d5 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -28,7 +28,7 @@ jobs: - name: Checkout uses: actions/checkout@v4 - name: Build - uses: ./.github/actions/build + uses: ./.github/actions/build/go with: go-version: ${{ env.GO_VERSION_BUILD }} - name: Generate SDK @@ -63,18 +63,16 @@ jobs: distribution: "temurin" java-version: ${{ env.JAVA_VERSION }} - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v4 - name: Build - uses: ./.github/actions/build - with: - go-version: ${{ env.GO_VERSION_BUILD }} + uses: ./.github/actions/build/python - name: Generate SDK uses: ./.github/actions/generate-sdk/python - name: Install Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - - name: Install core + - name: Install core run: | pip install poetry poetry config virtualenvs.create false @@ -82,10 +80,10 @@ jobs: cd core;make install; - name: Install sdk working-directory: ./sdk-repo-updated - run: make install-dev - - name: Lint + run: make install-dev + - name: Lint working-directory: ./sdk-repo-updated - run: make lint + run: make lint - name: Test working-directory: ./sdk-repo-updated run: make test