Skip to content

Commit

Permalink
Consistently use bash -c in docker exec commands, and use single quot…
Browse files Browse the repository at this point in the history
…es instead of double quotes to prevent host side shell expansion
  • Loading branch information
siggmo committed Sep 8, 2024
1 parent 7b88cc0 commit 5b556ac
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions .github/workflows/build_and_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,19 @@ jobs:
docker exec \
-w ${{ env.FANS_DIR }} \
${{ env.FANS_CONTAINER }} \
bash -c "mkdir -p ${{ env.FANS_BUILD_DIR }}"
bash -c ' \
mkdir -p ${{ env.FANS_BUILD_DIR }} \
'
- name: Configure
run: |
docker exec \
-w ${{ env.FANS_DIR }}/${{ env.FANS_BUILD_DIR }} \
${{ env.FANS_CONTAINER }} \
bash -c " \
bash -c ' \
cmake --version && \
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=ON .."
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=ON .. \
'
- uses: actions/upload-artifact@v4
if: failure()
Expand All @@ -81,15 +84,19 @@ jobs:
docker exec \
-w ${{ env.FANS_DIR }}/${{ env.FANS_BUILD_DIR }} \
${{ env.FANS_CONTAINER }} \
cmake --build . -j $(nproc) || cmake --build . -j1
bash -c ' \
cmake --build . -j $(nproc) || cmake --build . -j1 \
'
- name: Tests
run: |
docker exec \
-w ${{ env.FANS_DIR }}/${{ env.FANS_BUILD_DIR }} \
-e CTEST_OUTPUT_ON_FAILURE=1 \
${{ env.FANS_CONTAINER }} \
ctest
bash -c ' \
ctest
'
- uses: actions/upload-artifact@v4
if: failure()
Expand Down

0 comments on commit 5b556ac

Please sign in to comment.