From 80435866b0c8c94204545cbd9f7a6892930ef66a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Leclerc?= Date: Mon, 2 Dec 2024 15:31:39 +0100 Subject: [PATCH] Update snapshot-ci.yml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Clément Leclerc --- .github/workflows/snapshot-ci.yml | 69 +++++++++---------------------- 1 file changed, 20 insertions(+), 49 deletions(-) diff --git a/.github/workflows/snapshot-ci.yml b/.github/workflows/snapshot-ci.yml index 047033543..c1957ac67 100644 --- a/.github/workflows/snapshot-ci.yml +++ b/.github/workflows/snapshot-ci.yml @@ -14,21 +14,14 @@ jobs: name: Build ${{ matrix.config.name }} ${{ matrix.python.name }} wheel runs-on: ${{ matrix.config.os }} outputs: - matrix_result: ${{ steps.set_result.outputs.result }} build_status: ${{ steps.build_status.outputs.BUILD_STATUS_CONTENT }} strategy: matrix: config: - - { name: ubuntu, os: ubuntu-latest} - - { name: darwin, os: macos-12, macosx_deployment_target: "10.16", bdist_wheel_args: "--plat-name macosx-11.0-x86_64" } - { name: darwin-arm64, os: macos-14, macosx_deployment_target: "11", bdist_wheel_args: "--plat-name macosx-11.0-arm64" } - { name: windows, os: windows-2022 } python: - { name: cp38, version: '3.8' } - - { name: cp39, version: '3.9' } - - { name: cp310, version: '3.10' } - - { name: cp311, version: '3.11' } - - { name: cp312, version: '3.12' } fail-fast: false defaults: run: @@ -52,14 +45,6 @@ jobs: distribution: 'graalvm' github-token: ${{ secrets.GITHUB_TOKEN }} - #INITIALISE REPORT - - name: Initialize test summary - run: | - if [[ "${{ matrix.config.name }}" == "windows" ]]; then - mkdir -p $(dirname "$BUILD_STATUS") - fi - touch "$BUILD_STATUS" - #DEFINE SCRIPTS PATH - name: Set up script path run: | @@ -261,16 +246,11 @@ jobs: with: name: pypowsybl-wheel-${{ matrix.config.name }}-${{ matrix.python.name }} path: dist/*.whl - - name: Upload wheel - uses: actions/upload-artifact@v3 - with: - name: pypowsybl-wheel-${{ matrix.config.name }}-${{ matrix.python.name }} - path: dist/*.whl - - name: Record Matrix Status - if: always() + - name: Record Job Name + if: failure() run: | - echo "Config: ${{ matrix.config.name }}, Python: ${{ matrix.python.name }} - Status: ${{ job.status }}" >> $BUILD_STATUS + echo "Failed job : Build ${{ matrix.config.name }} ${{ matrix.python.name }} wheel" >> $BUILD_STATUS - name: Show Build Status Report if: always() @@ -280,31 +260,22 @@ jobs: cat $BUILD_STATUS echo "==========================" - - name: Read Build Status - if: always() - id: build_status - run: | - echo "BUILD_STATUS_CONTENT<> $GITHUB_OUTPUT - cat $BUILD_STATUS >> $GITHUB_OUTPUT - echo "EOF" >> $GITHUB_OUTPUT - - #SLACK NOTIFICATION ON FAILURE notify_slack: - needs: build_pypowsybl - runs-on: ubuntu-latest - if: failure() - steps: - - name: Send Slack Notification - uses: 8398a7/action-slack@v3 - with: - status: ${{ job.status }} - text: | - :x: *Failed workflow ${{ github.workflow }}* - *Matrix Jobs Status:* - ``` - ${{ needs.build_pypowsybl.outputs.build_status }} - ``` - See logs: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + needs: build_pypowsybl + runs-on: ubuntu-latest + if: failure() + steps: + - name: Send Slack Notification + uses: 8398a7/action-slack@v3 + with: + status: ${{ job.status }} + text: | + :x: *Failed workflow ${{ github.workflow }}* + *Failure details:* + ``` + ${{ needs.build_pypowsybl.outputs.build_status }} + ``` + See logs: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}