From cd619b6a96331032f1c1ae1b882abaa51f81bb98 Mon Sep 17 00:00:00 2001 From: Paul Baksic Date: Fri, 16 May 2025 15:41:51 +0200 Subject: [PATCH 1/2] Add 'Notify dasboard' step to CI --- .github/workflows/ci.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 34296ca..aa42b9a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,6 +41,7 @@ jobs: path: ${{ env.WORKSPACE_SRC_PATH }} - name: Build and install + id: build-and-tests shell: bash run: | if [[ "$RUNNER_OS" == "Windows" ]]; then @@ -69,12 +70,14 @@ jobs: ccache -s fi - name: Create artifact + id: create-artifact uses: actions/upload-artifact@v2 with: name: PluginExample_${{ steps.sofa.outputs.run_branch }}_for-SOFA-${{ steps.sofa.outputs.sofa_version }}_${{ runner.os }} path: ${{ env.WORKSPACE_INSTALL_PATH }} - name: Install artifact + id: install-artifact uses: actions/download-artifact@v2 with: name: PluginExample_${{ steps.sofa.outputs.run_branch }}_for-SOFA-${{ steps.sofa.outputs.sofa_version }}_${{ runner.os }} @@ -107,12 +110,39 @@ jobs: ls -la "$WORKSPACE_ARTIFACT_PATH" - name: Run test PluginExample_test + id: unit-tests if: always() shell: bash run: | cd $WORKSPACE_BUILD_PATH ./PluginExample_test/PluginExample_test${{ steps.sofa.outputs.exe }} + - name: Notify dashboard + if: always() && startsWith(github.repository, 'sofa-framework') && startsWith(github.ref, 'refs/heads/master') # we are not on a fork and on master + env: + DASH_AUTH: ${{ secrets.PLUGIN_DASH }} + shell: bash + run: | + test_status=$([ '${{ steps.unit-tests.outcome }}' == 'success' ] && \ + echo 'true' || echo 'false') + + build_status=$([ '${{ steps.build-and-tests.outcome }}' == 'success' ] && \ + echo 'true' || echo 'false') + + binary_status=$([ '${{ steps.create-artifact.outcome }}' == 'success' ] && \ + [ '${{ steps.install-artifact.outcome }}' == 'success' ] && \ + echo 'true' || echo 'false') + + + curl -X POST -H "X-API-KEY: $DASH_AUTH" -H "Content-Type: application/json" -d \ + "{\"id\":\"$(echo "${{ github.repository }}" | awk -F/ '{ print $2 }')\",\ + \"github_ref\":\"${{ github.sha }}\",\ + \"url\":\"https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}\",\ + \"build\":\"$build_status\",\ + \"tests\":\"$test_status\",\ + \"binary\":\"$binary_status\"}"\ + https://sofa-framework.org:5000/api/v1/plugins + deploy: name: Deploy artifacts if: always() && startsWith(github.ref, 'refs/heads/') # we are on a branch (not a PR) From 1699a294bb3c21c0a739d42f3a82333b7085fae6 Mon Sep 17 00:00:00 2001 From: Paul Baksic Date: Fri, 16 May 2025 16:13:03 +0200 Subject: [PATCH 2/2] Add 'Notify dasboard' step to CI --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index aa42b9a..3882885 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,7 +41,7 @@ jobs: path: ${{ env.WORKSPACE_SRC_PATH }} - name: Build and install - id: build-and-tests + id: build-and-install shell: bash run: | if [[ "$RUNNER_OS" == "Windows" ]]; then @@ -126,7 +126,7 @@ jobs: test_status=$([ '${{ steps.unit-tests.outcome }}' == 'success' ] && \ echo 'true' || echo 'false') - build_status=$([ '${{ steps.build-and-tests.outcome }}' == 'success' ] && \ + build_status=$([ '${{ steps.build-and-install.outcome }}' == 'success' ] && \ echo 'true' || echo 'false') binary_status=$([ '${{ steps.create-artifact.outcome }}' == 'success' ] && \