Skip to content

Commit 00b0b7e

Browse files
committed
Add step to notify dashboard, still need to add secret containing auth key
1 parent f385923 commit 00b0b7e

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ jobs:
4646
key: ccache_${{ runner.os }}
4747

4848
- name: Build and install
49+
id: build-install
4950
shell: bash
5051
run: |
5152
cmake_options="-GNinja \
@@ -91,6 +92,7 @@ jobs:
9192
echo "PYTHONPATH=$WORKSPACE_INSTALL_PATH/lib/python3/site-packages" | tee -a $GITHUB_ENV
9293
9394
- name: Generate stubfiles
95+
id: gen-stub
9496
shell: bash
9597
run: |
9698
@@ -121,12 +123,14 @@ jobs:
121123
echo "ARTIFACT_NAME=$ARTIFACT_NAME" | tee -a $GITHUB_ENV
122124
123125
- name: Create artifact
126+
id: gen-artifact
124127
uses: actions/upload-artifact@v4.4.0
125128
with:
126129
name: ${{ env.ARTIFACT_NAME }}
127130
path: ${{ env.WORKSPACE_INSTALL_PATH }}
128131

129132
- name: Install artifact
133+
id: install-artifact
130134
uses: actions/download-artifact@v4.1.7
131135
with:
132136
name: ${{ env.ARTIFACT_NAME }}
@@ -170,33 +174,65 @@ jobs:
170174
python -c "import sys; print('sys.version = ' + str(sys.version)); print('sys.path = ' + str(sys.path))"
171175
172176
- name: Run test Binding.Sofa.Tests
177+
id: test-sofa
173178
if: always()
174179
shell: bash
175180
run: |
176181
cd $WORKSPACE_ARTIFACT_PATH
177182
./bin/Bindings.Sofa.Tests${{ steps.sofa.outputs.exe }}
178183
179184
- name: Run test Bindings.SofaRuntime.Tests
185+
id: test-sofaruntime
180186
if: always()
181187
shell: bash
182188
run: |
183189
cd $WORKSPACE_ARTIFACT_PATH
184190
./bin/Bindings.SofaRuntime.Tests${{ steps.sofa.outputs.exe }}
185191
186192
- name: Run test Bindings.SofaTypes.Tests
193+
id: test-sofatypes
187194
if: always()
188195
shell: bash
189196
run: |
190197
cd $WORKSPACE_ARTIFACT_PATH
191198
./bin/Bindings.SofaTypes.Tests${{ steps.sofa.outputs.exe }}
192199
193200
- name: Run test Bindings.Modules.Tests
201+
id: test-sofamodules
194202
if: always()
195203
shell: bash
196204
run: |
197205
cd $WORKSPACE_ARTIFACT_PATH
198206
./bin/Bindings.Modules.Tests${{ steps.sofa.outputs.exe }}
199207
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+
shell: bash
211+
run: |
212+
test_status=$([ '${{ steps.test-sofa.outcome }}' == 'success' ] && \
213+
[ '${{ steps.test-sofaruntime.outcome }}' == 'success' ] && \
214+
[ '${{ steps.test-sofatypes.outcome }}' == 'success' ] && \
215+
[ '${{ steps.test-sofamodules.outcome }}' == 'success' ] && \
216+
echo 'true' || echo 'false')
217+
218+
build_status=$([ '${{ steps.build-install.outcome }}' == 'success' ] && \
219+
[ '${{ steps.gen-stub.outcome }}' == 'success' ] && \
220+
echo 'true' || echo 'false')
221+
222+
binary_status=$([ '${{ steps.gen-artifact.outcome }}' == 'success' ] && \
223+
[ '${{ steps.install-artifact.outcome }}' == 'success' ] && \
224+
echo 'true' || echo 'false')
225+
226+
227+
curl -X POST -H "X-API-KEY: ${{ secrets.PLUGIN_DASH }}" -H "Content-Type: application/json" -d \
228+
"{\"id":\"$(echo "${{ github.repository }}" | awk -F/ '{ print $2 }')\",\
229+
\"github_ref":\"${{ github.sha }}\",\
230+
\"url\":\"https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}\",\
231+
\"build\":\"\$build_status",\
232+
\"tests\":\"$test_status\",\
233+
\"binary\":\"$binary_status\"}"\
234+
https://sofa-framework.org:5000/api/v1/plugins
235+
200236
deploy:
201237
name: Deploy artifacts
202238
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

Comments
 (0)