|
41 | 41 | path: ${{ env.WORKSPACE_SRC_PATH }} |
42 | 42 |
|
43 | 43 | - name: Build and install |
| 44 | + id: build-and-install |
44 | 45 | shell: bash |
45 | 46 | run: | |
46 | 47 | if [[ "$RUNNER_OS" == "Windows" ]]; then |
@@ -82,12 +83,14 @@ jobs: |
82 | 83 | echo "artifact_name=$artifact_name" >> $env:GITHUB_OUTPUT |
83 | 84 |
|
84 | 85 | - name: Create artifact |
| 86 | + id: create-artifact |
85 | 87 | uses: actions/upload-artifact@v4.4.0 |
86 | 88 | with: |
87 | 89 | name: ${{ steps.sanitize.outputs.artifact_name }} |
88 | 90 | path: ${{ env.WORKSPACE_INSTALL_PATH }} |
89 | 91 |
|
90 | 92 | - name: Install artifact |
| 93 | + id: install-artifact |
91 | 94 | uses: actions/download-artifact@v4.1.7 |
92 | 95 | with: |
93 | 96 | name: ${{ steps.sanitize.outputs.artifact_name }} |
@@ -120,12 +123,40 @@ jobs: |
120 | 123 | ls -la "$WORKSPACE_ARTIFACT_PATH" |
121 | 124 |
|
122 | 125 | - name: Run test PluginExample_test |
| 126 | + id: unit-tests |
123 | 127 | if: always() |
124 | 128 | shell: bash |
125 | 129 | run: | |
126 | 130 | cd $WORKSPACE_BUILD_PATH |
127 | 131 | ./PluginExample_test/PluginExample_test${{ steps.sofa.outputs.exe }} |
128 | 132 |
|
| 133 | + - name: Notify dashboard |
| 134 | + if: always() && startsWith(github.repository, 'sofa-framework') && startsWith(github.ref, 'refs/heads/master') # we are not on a fork and on master |
| 135 | + env: |
| 136 | + DASH_AUTH: ${{ secrets.PLUGIN_DASH }} |
| 137 | + shell: bash |
| 138 | + run: | |
| 139 | + test_status=$([ '${{ steps.unit-tests.outcome }}' == 'success' ] && \ |
| 140 | + echo 'true' || echo 'false') |
| 141 | +
|
| 142 | + build_status=$([ '${{ steps.build-and-install.outcome }}' == 'success' ] && \ |
| 143 | + echo 'true' || echo 'false') |
| 144 | +
|
| 145 | + binary_status=$([ '${{ steps.create-artifact.outcome }}' == 'success' ] && \ |
| 146 | + [ '${{ steps.install-artifact.outcome }}' == 'success' ] && \ |
| 147 | + [ '${{ steps.sanitize.outcome }}' == 'success' ] && \ |
| 148 | + echo 'true' || echo 'false') |
| 149 | +
|
| 150 | +
|
| 151 | + curl -X POST -H "X-API-KEY: $DASH_AUTH" -H "Content-Type: application/json" -d \ |
| 152 | + "{\"id\":\"$(echo "${{ github.repository }}" | awk -F/ '{ print $2 }')\",\ |
| 153 | + \"github_ref\":\"${{ github.sha }}\",\ |
| 154 | + \"url\":\"https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}\",\ |
| 155 | + \"build\":\"$build_status\",\ |
| 156 | + \"tests\":\"$test_status\",\ |
| 157 | + \"binary\":\"$binary_status\"}"\ |
| 158 | + https://sofa-framework.org:5000/api/v1/plugins |
| 159 | +
|
129 | 160 | deploy: |
130 | 161 | name: Deploy artifacts |
131 | 162 | if: always() && startsWith(github.ref, 'refs/heads/') # we are on a branch (not a PR) |
|
0 commit comments