diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 192450e3..29ce8e26 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -51,30 +51,34 @@ jobs: integration-tests: name: Integration Tests needs: parse - if: ${{ !contains(github.event.release.body, 'skip-integration-tests') }} runs-on: ${{ contains(github.server_url, 'github.com') && 'ubuntu-latest' || fromJSON('["self-hosted"]') }} permissions: contents: read steps: - name: Checkout release branch + if: ${{ !contains(github.event.release.body, 'skip-integration-tests') }} uses: actions/checkout@v4 with: ref: ${{ needs.parse.outputs.branch }} fetch-depth: 0 - name: Set up Python + if: ${{ !contains(github.event.release.body, 'skip-integration-tests') }} uses: actions/setup-python@v6 with: python-version: "3.11" - name: Install uv + if: ${{ !contains(github.event.release.body, 'skip-integration-tests') }} uses: astral-sh/setup-uv@v3 - name: Install dependencies + if: ${{ !contains(github.event.release.body, 'skip-integration-tests') }} run: uv sync --dev - name: Set up integration test environment + if: ${{ !contains(github.event.release.body, 'skip-integration-tests') }} env: AICORE_CLIENT_ID: ${{ secrets.AICORE_CLIENT_ID }} AICORE_CLIENT_SECRET: ${{ secrets.AICORE_CLIENT_SECRET }} @@ -115,29 +119,19 @@ jobs: echo "Integration test environment set up." - name: Run integration tests + if: ${{ !contains(github.event.release.body, 'skip-integration-tests') }} run: uv run pytest tests/*/integration/ -v --tb=short - # ── 3. Gate (absorbs skipped integration-tests so publish is never auto-skipped) ── - gate: - name: Gate - needs: [parse, integration-tests] - if: always() && needs.parse.result == 'success' && (needs.integration-tests.result == 'success' || needs.integration-tests.result == 'skipped') - runs-on: ubuntu-latest - steps: - - run: echo "Gate passed" - - # ── 4. Publish ──────────────────────────────────────────────────────────── + # ── 3. Publish ──────────────────────────────────────────────────────────── publish: name: Publish - needs: [parse, gate] - if: needs.gate.result == 'success' + needs: [parse, integration-tests] + if: always() && needs.parse.result == 'success' && needs.integration-tests.result == 'success' runs-on: ubuntu-latest environment: 'pypi:sap-cloud-sdk' permissions: contents: write id-token: write - outputs: - release_url: ${{ steps.gh_release.outputs.release_url }} steps: - name: Checkout release branch @@ -190,11 +184,11 @@ jobs: - name: Publish to PyPI uses: pypa/gh-action-pypi-publish@v1.14.2 - # ── 5. Notify on failure ────────────────────────────────────────────────── + # ── 4. Notify on failure ────────────────────────────────────────────────── notify-failure: name: Notify Failure - needs: [parse, gate, publish] - if: always() && (needs.parse.result == 'failure' || needs.gate.result == 'failure' || needs.publish.result == 'failure') + needs: [parse, integration-tests, publish] + if: always() && (needs.parse.result == 'failure' || needs.integration-tests.result == 'failure' || needs.publish.result == 'failure') runs-on: ubuntu-latest permissions: contents: write