Skip to content

Commit 9e1e62d

Browse files
committed
build without network everywhere
1 parent 0f55078 commit 9e1e62d

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

.github/workflows/ccpp.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,8 @@ jobs:
149149
cd gccrs-build; \
150150
# Add cargo to our path quickly
151151
. "$HOME/.cargo/env";
152-
make -Otarget -j $(nproc) 2>&1 | tee log
152+
# Build without network access
153+
unshare --net --ipc -r /bin/bash -c "make -Otarget -j $(nproc) 2>&1 | tee log ; exit \${PIPESTATUS[0]}"
153154
154155
- name: Check for new warnings
155156
run: |
@@ -235,7 +236,8 @@ jobs:
235236
cd gccrs-build; \
236237
# Add cargo to our path quickly
237238
. "$HOME/.cargo/env";
238-
make -Otarget -j $(nproc) 2>&1 | tee log
239+
# Build without network access
240+
unshare --net --ipc -r /bin/bash -c "make -Otarget -j $(nproc) 2>&1 | tee log ; exit \${PIPESTATUS[0]}"
239241
240242
- name: Check for new warnings
241243
run: |
@@ -346,8 +348,8 @@ jobs:
346348
run: |
347349
# Add cargo to our path quickly
348350
. "$HOME/.cargo/env";
349-
PATH=$HOME/gcc-5.4.0/bin:$PATH \
350-
make -C gccrs-build -j $(nproc)
351+
# Build without network access
352+
PATH="$HOME/gcc-5.4.0/bin:$PATH" unshare --net --ipc -r /bin/bash -c "make -C gccrs-build -j $(nproc) ; exit \${PIPESTATUS[0]}"
351353
352354
- name: Run Tests
353355
run: |
@@ -409,7 +411,8 @@ jobs:
409411
shell: bash
410412
run: |
411413
cd gccrs-build; \
412-
make -j $(sysctl -n hw.ncpu) 2>&1 | tee log
414+
# Build without network access
415+
unshare --net --ipc -r /bin/bash -c "make -Otarget -j $(sysctl -n hw.ncpu) 2>&1 | tee log ; exit \${PIPESTATUS[0]}"
413416
414417
- name: Run Tests
415418
run: |
@@ -486,7 +489,8 @@ jobs:
486489
cd gccrs-build; \
487490
# Add cargo to our path quickly
488491
. "$HOME/.cargo/env";
489-
make -Otarget -j $(nproc) 2>&1 | tee log
492+
# Build without network access
493+
unshare --net --ipc -r /bin/bash -c "make -Otarget -j $(nproc) 2>&1 | tee log ; exit \${PIPESTATUS[0]}"
490494
491495
- name: Run Tests
492496
run: |

0 commit comments

Comments
 (0)