|
32 | 32 | path: ${{ env.WORKSPACE_SRC_PATH }}
|
33 | 33 |
|
34 | 34 | - name: Build and install
|
| 35 | + id: build-and-install |
35 | 36 | shell: bash
|
36 | 37 | run: |
|
37 | 38 | cmake_options="-GNinja \
|
@@ -72,12 +73,14 @@ jobs:
|
72 | 73 | echo "artifact_name=$artifact_name" >> $env:GITHUB_OUTPUT
|
73 | 74 |
|
74 | 75 | - name: Create artifact
|
| 76 | + id: create-artifact |
75 | 77 |
|
76 | 78 | with:
|
77 | 79 | name: ${{ steps.sanitize.outputs.artifact_name }}
|
78 | 80 | path: ${{ env.WORKSPACE_INSTALL_PATH }}
|
79 | 81 |
|
80 | 82 | - name: Install artifact
|
| 83 | + id: install-artifact |
81 | 84 |
|
82 | 85 | with:
|
83 | 86 | name: ${{ steps.sanitize.outputs.artifact_name }}
|
@@ -106,13 +109,41 @@ jobs:
|
106 | 109 | fi
|
107 | 110 |
|
108 | 111 | - name: Run Sofa.Metis_test
|
| 112 | + id: unit-tests |
109 | 113 | if: always()
|
110 | 114 | shell: bash
|
111 | 115 | run: |
|
112 | 116 | chmod +x $WORKSPACE_BUILD_PATH/tests/Sofa.Metis_test${{ steps.sofa.outputs.exe }}
|
113 | 117 | cd $WORKSPACE_BUILD_PATH
|
114 | 118 | ./tests/Sofa.Metis_test${{ steps.sofa.outputs.exe }}
|
115 | 119 |
|
| 120 | + - name: Notify dashboard |
| 121 | + if: always() && startsWith(github.repository, 'sofa-framework') && startsWith(github.ref, 'refs/heads/master') # we are not on a fork and on master |
| 122 | + env: |
| 123 | + DASH_AUTH: ${{ secrets.PLUGIN_DASH }} |
| 124 | + shell: bash |
| 125 | + run: | |
| 126 | + test_status=$([ '${{ steps.unit-tests.outcome }}' == 'success' ] && \ |
| 127 | + echo 'true' || echo 'false') |
| 128 | +
|
| 129 | + build_status=$([ '${{ steps.build-and-install.outcome }}' == 'success' ] && \ |
| 130 | + echo 'true' || echo 'false') |
| 131 | +
|
| 132 | + binary_status=$([ '${{ steps.create-artifact.outcome }}' == 'success' ] && \ |
| 133 | + [ '${{ steps.install-artifact.outcome }}' == 'success' ] && \ |
| 134 | + [ '${{ steps.sanitize.outcome }}' == 'success' ] && \ |
| 135 | + echo 'true' || echo 'false') |
| 136 | +
|
| 137 | +
|
| 138 | + curl -X POST -H "X-API-KEY: $DASH_AUTH" -H "Content-Type: application/json" -d \ |
| 139 | + "{\"id\":\"$(echo "${{ github.repository }}" | awk -F/ '{ print $2 }')\",\ |
| 140 | + \"github_ref\":\"${{ github.sha }}\",\ |
| 141 | + \"url\":\"https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}\",\ |
| 142 | + \"build\":\"$build_status\",\ |
| 143 | + \"tests\":\"$test_status\",\ |
| 144 | + \"binary\":\"$binary_status\"}"\ |
| 145 | + https://sofa-framework.org:5000/api/v1/plugins |
| 146 | +
|
116 | 147 | deploy:
|
117 | 148 | name: Deploy artifacts
|
118 | 149 | if: always() && startsWith(github.ref, 'refs/heads/') # we are on a branch (not a PR)
|
|
0 commit comments