Skip to content

Commit

Permalink
build: disable internet access during the build step (#241)
Browse files Browse the repository at this point in the history
Signed-off-by: Esteve Fernandez <esteve.fernandez@tier4.jp>
  • Loading branch information
esteve authored Sep 20, 2023
1 parent 781cd4e commit 9ca3518
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions colcon-build/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,17 @@ runs:
- name: Build
run: |
. /opt/ros/${{ inputs.rosdistro }}/setup.sh
# Cannot use unshare inside a Docker container, so we just disable
# DNS lookups instead.
cat /etc/nsswitch.conf
sed -e 's#hosts:\(.*\)dns\(.*\)#hosts:\1\2#g' -i.bak /etc/nsswitch.conf
cat /etc/nsswitch.conf
colcon build --event-handlers console_cohesion+ \
--packages-above-and-dependencies ${{ inputs.target-packages }} \
--cmake-args -DCMAKE_BUILD_TYPE=${{ inputs.cmake-build-type }} \
--mixin coverage-gcc coverage-pytest compile-commands
mv /etc/nsswitch.conf.bak /etc/nsswitch.conf
cat /etc/nsswitch.conf
shell: bash

- name: Cache build artifacts
Expand Down

0 comments on commit 9ca3518

Please sign in to comment.