Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jobs:
path: ${{ env.WORKSPACE_SRC_PATH }}

- name: Build and install
id: build-and-install
shell: bash
run: |
cmake_options="-GNinja \
Expand Down Expand Up @@ -72,12 +73,14 @@ jobs:
echo "artifact_name=$artifact_name" >> $env:GITHUB_OUTPUT

- name: Create artifact
id: create-artifact
uses: actions/[email protected]
with:
name: ${{ steps.sanitize.outputs.artifact_name }}
path: ${{ env.WORKSPACE_INSTALL_PATH }}

- name: Install artifact
id: install-artifact
uses: actions/[email protected]
with:
name: ${{ steps.sanitize.outputs.artifact_name }}
Expand Down Expand Up @@ -106,13 +109,41 @@ jobs:
fi

- name: Run Sofa.Metis_test
id: unit-tests
if: always()
shell: bash
run: |
chmod +x $WORKSPACE_BUILD_PATH/tests/Sofa.Metis_test${{ steps.sofa.outputs.exe }}
cd $WORKSPACE_BUILD_PATH
./tests/Sofa.Metis_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-install.outcome }}' == 'success' ] && \
echo 'true' || echo 'false')

binary_status=$([ '${{ steps.create-artifact.outcome }}' == 'success' ] && \
[ '${{ steps.install-artifact.outcome }}' == 'success' ] && \
[ '${{ steps.sanitize.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)
Expand Down
Loading