Skip to content

Commit

Permalink
Patch CI actions and Dockerfiles (ros-navigation#3468)
Browse files Browse the repository at this point in the history
* Unset default value for FAIL_ON_TEST_FAILURE
as unsetting it via --build-arg seems unreliable
docker/compose#3608

* Use build arg default for failing on test failers

* Update from deprecated set-output commands
https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
  • Loading branch information
ruffsl authored Mar 10, 2023
1 parent 2cd7f21 commit 6c7070f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 14 deletions.
17 changes: 8 additions & 9 deletions .github/workflows/update_ci_image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ jobs:
id: check
if: github.event_name == 'push'
run: |
echo "::set-output name=trigger::true"
echo "::set-output name=no_cache::false"
echo "trigger=true" >> $GITHUB_OUTPUT
echo "no_cache=false" >> $GITHUB_OUTPUT
check_ci_image:
name: Check CI Image
if: github.event_name == 'schedule'
Expand All @@ -52,9 +52,9 @@ jobs:
cat upgrade.log
cat upgrade.log \
| grep "^0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.$" \
&& echo "::set-output name=trigger::false" \
|| echo "::set-output name=trigger::true"
echo "::set-output name=no_cache::true"
&& echo "trigger=false" >> $GITHUB_OUTPUT \
|| echo "trigger=true" >> $GITHUB_OUTPUT
echo "no_cache=true" >> $GITHUB_OUTPUT
rebuild_ci_image:
name: Rebuild CI Image
if: always()
Expand All @@ -75,23 +75,23 @@ jobs:
id: config
run: |
timestamp=$(date --utc +%Y%m%d%H%M%S)
echo "::set-output name=timestamp::${timestamp}"
echo "timestamp=${timestamp}" >> $GITHUB_OUTPUT
no_cache=false
if [ "${{needs.check_ci_files.outputs.no_cache}}" == 'true' ] || \
[ "${{needs.check_ci_image.outputs.no_cache}}" == 'true' ]
then
no_cache=true
fi
echo "::set-output name=no_cache::${no_cache}"
echo "no_cache=${no_cache}" >> $GITHUB_OUTPUT
trigger=false
if [ "${{needs.check_ci_files.outputs.trigger}}" == 'true' ] || \
[ "${{needs.check_ci_image.outputs.trigger}}" == 'true' ]
then
trigger=true
fi
echo "::set-output name=trigger::${trigger}"
echo "trigger=${trigger}" >> $GITHUB_OUTPUT
- name: Build and push ${{ github.ref_name }}
if: steps.config.outputs.trigger == 'true'
id: docker_build
Expand Down Expand Up @@ -122,7 +122,6 @@ jobs:
cache-to: type=inline
build-args: |
RUN_TESTS=True
FAIL_ON_TEST_FAILURE=''
target: tester
tags: |
ghcr.io/ros-planning/navigation2:${{ github.ref_name }}-dev
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ RUN sed --in-place \

# test overlay build
ARG RUN_TESTS
ARG FAIL_ON_TEST_FAILURE=True
ARG FAIL_ON_TEST_FAILURE
RUN if [ -n "$RUN_TESTS" ]; then \
. install/setup.sh && \
colcon test && \
Expand Down
2 changes: 1 addition & 1 deletion tools/distro.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ RUN sed --in-place \

# test overlay build
ARG RUN_TESTS
ARG FAIL_ON_TEST_FAILURE=True
ARG FAIL_ON_TEST_FAILURE
RUN if [ -n "$RUN_TESTS" ]; then \
. install/setup.sh && \
colcon test && \
Expand Down
6 changes: 3 additions & 3 deletions tools/source.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ FROM ros2_builder AS ros2_tester

# test overlay build
ARG RUN_TESTS
ARG FAIL_ON_TEST_FAILURE=True
ARG FAIL_ON_TEST_FAILURE
RUN if [ -n "$RUN_TESTS" ]; then \
. install/setup.sh && \
colcon test && \
Expand Down Expand Up @@ -165,7 +165,7 @@ FROM underlay_builder AS underlay_tester

# test overlay build
ARG RUN_TESTS
ARG FAIL_ON_TEST_FAILURE=True
ARG FAIL_ON_TEST_FAILURE
RUN if [ -n "$RUN_TESTS" ]; then \
. install/setup.sh && \
colcon test && \
Expand Down Expand Up @@ -216,7 +216,7 @@ FROM overlay_builder AS overlay_tester

# test overlay build
ARG RUN_TESTS
ARG FAIL_ON_TEST_FAILURE=True
ARG FAIL_ON_TEST_FAILURE
RUN if [ -n "$RUN_TESTS" ]; then \
. install/setup.sh && \
colcon test && \
Expand Down

0 comments on commit 6c7070f

Please sign in to comment.