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
38 changes: 38 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ jobs:
key: ccache_${{ runner.os }}

- name: Build and install
id: build-install
shell: bash
run: |
cmake_options="-GNinja \
Expand Down Expand Up @@ -91,6 +92,7 @@ jobs:
echo "PYTHONPATH=$WORKSPACE_INSTALL_PATH/lib/python3/site-packages" | tee -a $GITHUB_ENV

- name: Generate stubfiles
id: gen-stub
shell: bash
run: |

Expand Down Expand Up @@ -121,12 +123,14 @@ jobs:
echo "ARTIFACT_NAME=$ARTIFACT_NAME" | tee -a $GITHUB_ENV

- name: Create artifact
id: gen-artifact
uses: actions/upload-artifact@v4.4.0
with:
name: ${{ env.ARTIFACT_NAME }}
path: ${{ env.WORKSPACE_INSTALL_PATH }}

- name: Install artifact
id: install-artifact
uses: actions/download-artifact@v4.1.7
with:
name: ${{ env.ARTIFACT_NAME }}
Expand Down Expand Up @@ -170,33 +174,67 @@ jobs:
python -c "import sys; print('sys.version = ' + str(sys.version)); print('sys.path = ' + str(sys.path))"

- name: Run test Binding.Sofa.Tests
id: test-sofa
if: always()
shell: bash
run: |
cd $WORKSPACE_ARTIFACT_PATH
./bin/Bindings.Sofa.Tests${{ steps.sofa.outputs.exe }}

- name: Run test Bindings.SofaRuntime.Tests
id: test-sofaruntime
if: always()
shell: bash
run: |
cd $WORKSPACE_ARTIFACT_PATH
./bin/Bindings.SofaRuntime.Tests${{ steps.sofa.outputs.exe }}

- name: Run test Bindings.SofaTypes.Tests
id: test-sofatypes
if: always()
shell: bash
run: |
cd $WORKSPACE_ARTIFACT_PATH
./bin/Bindings.SofaTypes.Tests${{ steps.sofa.outputs.exe }}

- name: Run test Bindings.Modules.Tests
id: test-sofamodules
if: always()
shell: bash
run: |
cd $WORKSPACE_ARTIFACT_PATH
./bin/Bindings.Modules.Tests${{ 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.test-sofa.outcome }}' == 'success' ] && \
[ '${{ steps.test-sofaruntime.outcome }}' == 'success' ] && \
[ '${{ steps.test-sofatypes.outcome }}' == 'success' ] && \
[ '${{ steps.test-sofamodules.outcome }}' == 'success' ] && \
echo 'true' || echo 'false')

build_status=$([ '${{ steps.build-install.outcome }}' == 'success' ] && \
[ '${{ steps.gen-stub.outcome }}' == 'success' ] && \
echo 'true' || echo 'false')

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