|
46 | 46 | key: ccache_${{ runner.os }} |
47 | 47 |
|
48 | 48 | - name: Build and install |
| 49 | + id: build-install |
49 | 50 | shell: bash |
50 | 51 | run: | |
51 | 52 | cmake_options="-GNinja \ |
|
91 | 92 | echo "PYTHONPATH=$WORKSPACE_INSTALL_PATH/lib/python3/site-packages" | tee -a $GITHUB_ENV |
92 | 93 |
|
93 | 94 | - name: Generate stubfiles |
| 95 | + id: gen-stub |
94 | 96 | shell: bash |
95 | 97 | run: | |
96 | 98 | |
@@ -121,12 +123,14 @@ jobs: |
121 | 123 | echo "ARTIFACT_NAME=$ARTIFACT_NAME" | tee -a $GITHUB_ENV |
122 | 124 |
|
123 | 125 | - name: Create artifact |
| 126 | + id: gen-artifact |
124 | 127 | |
125 | 128 | with: |
126 | 129 | name: ${{ env.ARTIFACT_NAME }} |
127 | 130 | path: ${{ env.WORKSPACE_INSTALL_PATH }} |
128 | 131 |
|
129 | 132 | - name: Install artifact |
| 133 | + id: install-artifact |
130 | 134 | |
131 | 135 | with: |
132 | 136 | name: ${{ env.ARTIFACT_NAME }} |
@@ -170,33 +174,67 @@ jobs: |
170 | 174 | python -c "import sys; print('sys.version = ' + str(sys.version)); print('sys.path = ' + str(sys.path))" |
171 | 175 |
|
172 | 176 | - name: Run test Binding.Sofa.Tests |
| 177 | + id: test-sofa |
173 | 178 | if: always() |
174 | 179 | shell: bash |
175 | 180 | run: | |
176 | 181 | cd $WORKSPACE_ARTIFACT_PATH |
177 | 182 | ./bin/Bindings.Sofa.Tests${{ steps.sofa.outputs.exe }} |
178 | 183 | |
179 | 184 | - name: Run test Bindings.SofaRuntime.Tests |
| 185 | + id: test-sofaruntime |
180 | 186 | if: always() |
181 | 187 | shell: bash |
182 | 188 | run: | |
183 | 189 | cd $WORKSPACE_ARTIFACT_PATH |
184 | 190 | ./bin/Bindings.SofaRuntime.Tests${{ steps.sofa.outputs.exe }} |
185 | 191 | |
186 | 192 | - name: Run test Bindings.SofaTypes.Tests |
| 193 | + id: test-sofatypes |
187 | 194 | if: always() |
188 | 195 | shell: bash |
189 | 196 | run: | |
190 | 197 | cd $WORKSPACE_ARTIFACT_PATH |
191 | 198 | ./bin/Bindings.SofaTypes.Tests${{ steps.sofa.outputs.exe }} |
192 | 199 | |
193 | 200 | - name: Run test Bindings.Modules.Tests |
| 201 | + id: test-sofamodules |
194 | 202 | if: always() |
195 | 203 | shell: bash |
196 | 204 | run: | |
197 | 205 | cd $WORKSPACE_ARTIFACT_PATH |
198 | 206 | ./bin/Bindings.Modules.Tests${{ steps.sofa.outputs.exe }} |
199 | 207 |
|
| 208 | + - name: Notify dashboard |
| 209 | + if: always() && startsWith(github.repository, 'sofa-framework') && startsWith(github.ref, 'refs/heads/master') # we are not on a fork and on master |
| 210 | + env: |
| 211 | + DASH_AUTH: ${{ secrets.PLUGIN_DASH }} |
| 212 | + shell: bash |
| 213 | + run: | |
| 214 | + test_status=$([ '${{ steps.test-sofa.outcome }}' == 'success' ] && \ |
| 215 | + [ '${{ steps.test-sofaruntime.outcome }}' == 'success' ] && \ |
| 216 | + [ '${{ steps.test-sofatypes.outcome }}' == 'success' ] && \ |
| 217 | + [ '${{ steps.test-sofamodules.outcome }}' == 'success' ] && \ |
| 218 | + echo 'true' || echo 'false') |
| 219 | +
|
| 220 | + build_status=$([ '${{ steps.build-install.outcome }}' == 'success' ] && \ |
| 221 | + [ '${{ steps.gen-stub.outcome }}' == 'success' ] && \ |
| 222 | + echo 'true' || echo 'false') |
| 223 | +
|
| 224 | + binary_status=$([ '${{ steps.gen-artifact.outcome }}' == 'success' ] && \ |
| 225 | + [ '${{ steps.install-artifact.outcome }}' == 'success' ] && \ |
| 226 | + echo 'true' || echo 'false') |
| 227 | + |
| 228 | +
|
| 229 | + curl -X POST -H "X-API-KEY: $DASH_AUTH" -H "Content-Type: application/json" -d \ |
| 230 | + "{\"id\":\"$(echo "${{ github.repository }}" | awk -F/ '{ print $2 }')\",\ |
| 231 | + \"github_ref\":\"${{ github.sha }}\",\ |
| 232 | + \"url\":\"https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}\",\ |
| 233 | + \"build\":\"$build_status\",\ |
| 234 | + \"tests\":\"$test_status\",\ |
| 235 | + \"binary\":\"$binary_status\"}"\ |
| 236 | + https://sofa-framework.org:5000/api/v1/plugins |
| 237 | +
|
200 | 238 | deploy: |
201 | 239 | name: Deploy artifacts |
202 | 240 | if: always() && startsWith(github.repository, 'sofa-framework') && (startsWith(github.ref, 'refs/heads/') || startsWith(github.ref, 'refs/tags/')) # we are not on a fork and on a branch or a tag (not a PR) |
|
0 commit comments