Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/identify-ros-distro.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ on:
description: "The ROS compatible Linux version"
value: ${{ jobs.identify-ros-distro.outputs.linuxos }}
env:
ROLLING_VAR: ${{ contains(github.ref, 'develop') }}
KILTED_VAR: ${{ contains(github.ref, 'kilted') }}
JAZZY_VAR: ${{ contains(github.ref, 'jazzy') }}
IRON_VAR: ${{ contains(github.ref, 'iron') }}
HUMBLE_VAR: ${{ contains(github.ref, 'humble') }}
ROLLING_VAR: ${{ contains(github.ref, 'develop') || contains(github.base_ref, 'develop') }}
KILTED_VAR: ${{ contains(github.ref, 'kilted') || contains(github.base_ref, 'kilted') }}
JAZZY_VAR: ${{ contains(github.ref, 'jazzy') || contains(github.base_ref, 'jazzy') }}
IRON_VAR: ${{ contains(github.ref, 'iron') || contains(github.base_ref, 'iron') }}
HUMBLE_VAR: ${{ contains(github.ref, 'humble') || contains(github.base_ref, 'humble') }}

jobs:
identify-ros-distro:
Expand Down
26 changes: 17 additions & 9 deletions .github/workflows/linux-build-and-test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

name: rclnodejs - Linux Build and Test

on:
Expand All @@ -24,8 +23,21 @@ jobs:
identify-ros-distro:
uses: ./.github/workflows/identify-ros-distro.yml

matrix-prep:
runs-on: ubuntu-latest
outputs:
arm64-matrix: ${{ steps.set-matrix.outputs.arm64-matrix }}
steps:
- id: set-matrix
run: |
if [[ ${{ contains(github.base_ref, 'develop') || contains(github.ref, 'develop') }} ]]; then
Copy link

Copilot AI May 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The bash conditional [[ ${{ ... }} ]] always succeeds since both 'true' and 'false' are non-empty strings. Compare the expression explicitly to 'true' (e.g., if [ "${{ contains(...) }}" = 'true' ]; then) or use if ${{ contains(...) }}; then to make the branch logic correct.

Suggested change
if [[ ${{ contains(github.base_ref, 'develop') || contains(github.ref, 'develop') }} ]]; then
if [ "${{ contains(github.base_ref, 'develop') || contains(github.ref, 'develop') }}" = 'true' ]; then

Copilot uses AI. Check for mistakes.
echo "arm64-matrix=[{\"architecture\":\"arm64\",\"node-version\":\"22.X\",\"ubuntu-version\":\"24.04-arm\"}]" >> $GITHUB_OUTPUT
else
echo "arm64-matrix=[]" >> $GITHUB_OUTPUT
fi

build:
needs: identify-ros-distro
needs: [identify-ros-distro, matrix-prep]
runs-on: ubuntu-${{ matrix.ubuntu-version }}
container:
image: ${{ needs.identify-ros-distro.outputs.linuxos }}
Expand All @@ -35,12 +47,8 @@ jobs:
node-version: [20.X, 22.X, 24.X]
architecture: [x64]
ubuntu-version: [latest]
# Add arm64 support for rolling.
include:
- architecture: arm64
node-version: 22.X
ubuntu-version: 24.04-arm
exclude: ${{ !contains(github.ref, 'develop') }}
# Include arm64 configuration from matrix-prep job
include: ${{ fromJSON(needs.matrix-prep.outputs.arm64-matrix) }}
steps:
- name: Setup Node.js ${{ matrix.node-version }} on ${{ matrix.architecture }}
uses: actions/setup-node@v4
Expand Down Expand Up @@ -84,4 +92,4 @@ jobs:
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true
parallel-finished: true
Loading