|
29 | 29 | path: ${{ env.WORKSPACE_SRC_PATH }} |
30 | 30 |
|
31 | 31 | - name: Build and install |
| 32 | + id: build-install |
32 | 33 | shell: bash |
33 | 34 | run: | |
34 | 35 | if [[ "$RUNNER_OS" == "Windows" ]]; then |
@@ -70,81 +71,62 @@ jobs: |
70 | 71 | echo "artifact_name=$artifact_name" >> $env:GITHUB_OUTPUT |
71 | 72 | |
72 | 73 | - name: Create artifact |
| 74 | + id: create-artifact |
73 | 75 | uses: actions/upload-artifact@v4.4.0 |
74 | 76 | with: |
75 | 77 | name: ${{ steps.sanitize.outputs.artifact_name }} |
76 | 78 | path: ${{ env.WORKSPACE_INSTALL_PATH }} |
77 | 79 |
|
78 | 80 | - name: Install artifact |
| 81 | + id: install-artifact |
79 | 82 | uses: actions/download-artifact@v4.1.7 |
80 | 83 | with: |
81 | 84 | name: ${{ steps.sanitize.outputs.artifact_name }} |
82 | 85 | path: ${{ env.WORKSPACE_ARTIFACT_PATH }} |
83 | 86 |
|
84 | | - - name: Set env vars for tests |
| 87 | + |
| 88 | + - name: Launch test |
| 89 | + id: tests |
| 90 | + uses: sofa-framework/sofa-test-action@v1.0 |
| 91 | + with: |
| 92 | + sofa_root: ${{ github.workspace }}/sofa |
| 93 | + sofa_version: ${{ steps.sofa.outputs.sofa_version }} |
| 94 | + src_dir: ${{ env.WORKSPACE_SRC_PATH }} |
| 95 | + build_dir: ${{ env.WORKSPACE_BUILD_PATH }} |
| 96 | + python_exe: ${{ steps.sofa.outputs.python_exe }} |
| 97 | + output_dir: ${{ github.workspace }}/tests-results_dir |
| 98 | + nb_parallel_threads: '4' |
| 99 | + |
| 100 | + - name: Notify dashboard |
| 101 | + if: always() && startsWith(github.repository, 'sofa-framework') && startsWith(github.ref, 'refs/heads/master') # we are not on a fork and on master |
| 102 | + env: |
| 103 | + DASH_AUTH: ${{ secrets.PLUGIN_DASH }} |
85 | 104 | shell: bash |
86 | 105 | run: | |
87 | | - # Set env vars for tests |
88 | | - if [[ "$RUNNER_OS" == "Windows" ]]; then |
89 | | - echo "$WORKSPACE_ARTIFACT_PATH/lib" >> $GITHUB_PATH |
90 | | - echo "$WORKSPACE_ARTIFACT_PATH/bin" >> $GITHUB_PATH |
91 | | - echo "$SOFA_ROOT/plugins/SofaPython3/bin" >> $GITHUB_PATH |
92 | | - echo "SOFA_PLUGIN_PATH=$WORKSPACE_ARTIFACT_PATH/bin" | tee -a $GITHUB_ENV |
93 | | - else |
94 | | - echo "SOFA_PLUGIN_PATH=$WORKSPACE_ARTIFACT_PATH/lib" | tee -a $GITHUB_ENV |
95 | | - fi |
96 | 106 |
|
97 | | - if [[ "$RUNNER_OS" == "macOS" ]]; then |
98 | | - echo "DYLD_LIBRARY_PATH=$WORKSPACE_ARTIFACT_PATH/lib:$SOFA_ROOT/lib:$SOFA_ROOT/plugins/SofaPython3/lib:$DYLD_LIBRARY_PATH" | tee -a $GITHUB_ENV |
99 | | - fi |
| 107 | + test_status=$([ '${{ steps.tests.outcome }}' == 'success' ] && \&& \ |
| 108 | + echo 'true' || echo 'false') |
100 | 109 |
|
101 | | - if [[ "$RUNNER_OS" == "Linux" ]]; then |
102 | | - echo "LD_LIBRARY_PATH=$WORKSPACE_ARTIFACT_PATH/lib:$SOFA_ROOT/lib:$SOFA_ROOT/plugins/SofaPython3/lib:$LD_LIBRARY_PATH" | tee -a $GITHUB_ENV |
103 | | - fi |
| 110 | + build_status=$([ '${{ steps.build-install.outcome }}' == 'success' ] && \ |
| 111 | + echo 'true' || echo 'false') |
104 | 112 |
|
105 | | - # - name: Check environment for tests |
106 | | - # shell: bash |
107 | | - # run: | |
108 | | - # echo '------ ls -la "$WORKSPACE_SRC_PATH" ------' |
109 | | - # ls -la "$WORKSPACE_SRC_PATH" |
110 | | - # echo '------ ls -la "$WORKSPACE_BUILD_PATH" ------' |
111 | | - # ls -la "$WORKSPACE_BUILD_PATH" |
112 | | - # echo '------ ls -la "$WORKSPACE_INSTALL_PATH" ------' |
113 | | - # ls -la "$WORKSPACE_INSTALL_PATH" |
114 | | - # echo '------ ls -la "$WORKSPACE_ARTIFACT_PATH" ------' |
115 | | - # ls -la "$WORKSPACE_ARTIFACT_PATH" |
116 | | - # echo '----------------------' |
117 | | - # echo "SOFA_ROOT = $SOFA_ROOT" |
| 113 | + binary_status=$([ '${{ steps.sanitize.outcome }}' == 'success' ] && \ |
| 114 | + [ '${{ steps.create-artifact.outcome }}' == 'success' ] && \ |
| 115 | + [ '${{ steps.install-artifact.outcome }}' == 'success' ] && \ |
| 116 | + echo 'true' || echo 'false') |
| 117 | + os=$(echo "${{ matrix.os }}" | awk -F- '{ print $1 }') |
118 | 118 |
|
119 | | - - name: Run BeamAdapter_test |
120 | | - if: always() |
121 | | - shell: bash |
122 | | - run: | |
123 | | - chmod +x $WORKSPACE_BUILD_PATH/bin/BeamAdapter_test${{ steps.sofa.outputs.exe }} |
124 | | - cd $WORKSPACE_BUILD_PATH |
125 | | - ./bin/BeamAdapter_test${{ steps.sofa.outputs.exe }} |
126 | 119 |
|
127 | | - - name: Fetch, install and run Regression_test |
128 | | - if: always() |
129 | | - shell: bash |
130 | | - run: | |
131 | | - if [[ "$RUNNER_OS" != "macOS" ]]; then |
132 | | - # Get regression from github releases |
133 | | - mkdir -p "${{ runner.temp }}/regression_tmp/install" |
134 | | - curl --output "${{ runner.temp }}/regression_tmp/${RUNNER_OS}.zip" -L https://github.com/sofa-framework/regression/releases/download/release-master/Regression_test_master_for-SOFA-${{ steps.sofa.outputs.sofa_version }}_${RUNNER_OS}.zip |
135 | | - unzip -qq "${{ runner.temp }}/regression_tmp/${RUNNER_OS}.zip" -d "${{ runner.temp }}/regression_tmp/install" |
136 | | - # Install it in the SOFA bin directory |
137 | | - $SUDO mv "${{ runner.temp }}"/regression_tmp/install/Regression_*/bin/* "${SOFA_ROOT}/bin" |
138 | | - chmod +x ${SOFA_ROOT}/bin/Regression_test${{ steps.sofa.outputs.exe }} |
139 | | - # Setup mandatory env vars |
140 | | - export REGRESSION_SCENES_DIR="${WORKSPACE_SRC_PATH}/examples" |
141 | | - export REGRESSION_REFERENCES_DIR="${WORKSPACE_SRC_PATH}/regression/references" |
142 | | - export PYTHONPATH=$SOFA_ROOT/plugins/SofaPython3/lib/python3/site-packages |
143 | | - # Run regression test bench |
144 | | - ${SOFA_ROOT}/bin/Regression_test${{ steps.sofa.outputs.exe }} |
145 | | - else |
146 | | - echo "Regression tests are not supported on the CI for macOS yet (TODO)" |
147 | | - fi |
| 120 | + curl -X POST -H "X-API-KEY: $DASH_AUTH" -H "Content-Type: application/json" -d \ |
| 121 | + "{\"id\":\"$(echo "${{ github.repository }}" | awk -F/ '{ print $2 }')\",\ |
| 122 | + \"github_ref\":\"${{ github.sha }}\",\ |
| 123 | + \"url\":\"https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}\",\ |
| 124 | + \"build\":$build_status,\ |
| 125 | + \"tests\":$test_status,\ |
| 126 | + \"os\":\"$os\",\ |
| 127 | + \"binary\":$binary_status}"\ |
| 128 | + https://sofa-framework.org:5000/api/v1/plugins |
| 129 | +
|
148 | 130 |
|
149 | 131 | deploy: |
150 | 132 | name: Deploy artifacts |
|
0 commit comments