Skip to content

Commit

Permalink
Refs #19657. Using eprosima-ci
Browse files Browse the repository at this point in the history
Signed-off-by: Ricardo González Moreno <[email protected]>
  • Loading branch information
richiware committed Oct 22, 2023
1 parent e630528 commit 3267b2f
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 81 deletions.
111 changes: 32 additions & 79 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,54 +19,23 @@ jobs:

steps:

- name: install OpenSSL
shell: pwsh
run: |
choco install openssl -yr --no-progress
"System32;SysWoW64" -split ";" | Join-Path -Path $env:windir -ChildPath {$_} `
| ls -Include libssl-*.dll | rm
- name: Install ninja
if: github.event.schedule == ''
shell: pwsh
run: choco install ninja

- name: Setting ninja
id: ninja
if: github.event.schedule == ''
shell: pwsh
run: echo "cmake_generator=ninja" >> $Env:GITHUB_OUTPUT
- uses: eProsima/eProsima-CI/windows/install_openssl@v0

- name: Install swig
shell: pwsh
run: choco install swig --allow-downgrade --version=4.0.2.04082020

- name: Install python build dependencies
shell: pwsh
run: |
pip install -U colcon-common-extensions colcon-mixin vcstool;
colcon mixin add default https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml; colcon mixin update default
- uses: eProsima/eProsima-CI/external/setup-python@feature/ccache
with:
python-version: '3.11'

- name: Install python tests dependencies
shell: pwsh
run: |
cd (ni -Type Directory -Path "$Env:TMP\$(New-Guid)")
$cr = "`n"
'cmake_minimum_required(VERSION 3.5)' + $cr +
'project(dummy VERSION 1.0.0 LANGUAGES CXX)' + $cr +
'find_package (Python3 COMPONENTS Interpreter Development REQUIRED)' + $cr +
'message(STATUS "cmake detected python=>>>>>${Python3_EXECUTABLE}<<<<<<")' |
Out-File CMakeLists.txt
(cmake .) *>&1 | % {
if($_ -Match "cmake detected python=>>>>>(?<exec>.*)<<<<<<")
{
$python_exec = $Matches.exec
return
}
}
& $python_exec -m pip install -U pytest pywin32
- uses: actions/checkout@v4
- uses: eProsima/eProsima-CI/windows/install_python_packages@feature/ccache
with:
packages: pytest pywin32 vcstool

- uses: eProsima/eProsima-CI/windows/install_colcon@feature/ccache

- uses: eProsima/eProsima-CI/external/checkout@v0
with:
path: src/fastdds_python

Expand All @@ -75,28 +44,20 @@ jobs:
run: |
vcs import src --skip-existing --input src/fastdds_python/fastdds_python.repos
- name: Get minimum supported version of CMake
uses: lukka/get-cmake@latest
- uses: eProsima/eProsima-CI/external/get-cmake@feature/ccache
with:
cmakeVersion: 3.22.6

- name: Use cmake
run: cmake --version

- name: Install ccache
- name: Setting ninja
id: ninja
if: github.event.schedule == ''
shell: pwsh
run: |
pwsh -File "src\fastdds_python\.github\ci\ccache.ps1"
$ccache_dir = $pwd.PATH
$ccache_dir = "$ccache_dir\.github\ccache"
echo "$ccache_dir" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
Set-Item -Force -Path "env:PATH" -Value "$ccache_dir;$env:PATH"
ccache --version
echo "cmake_generator=ninja" >> $Env:GITHUB_OUTPUT
- name: Setup ccache
uses: Chocobo1/setup-ccache-action@v1
uses: eProsima/eProsima-CI/external/setup-ccache-action@feature/ccache
with:
prepend_symlinks_to_path: false
install_ccache: false
windows_compile_environment: msvc

Expand All @@ -108,6 +69,7 @@ jobs:
Import-Module $modulepath
Enter-VsDevShell -SetDefaultWindowTitle -InstallPath $installpath `
-StartInPath (pwd) -DevCmdArguments '/arch=x64 /host_arch=x64';
cmake --version
colcon build --executor parallel --event-handlers console_direct+ desktop_notification- `
--metas ./src/fastdds_python/.github/workflows/test.meta `
--mixin rel-with-deb-info ccache ${{ steps.ninja.outputs.cmake_generator }}
Expand All @@ -129,43 +91,34 @@ jobs:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v4
- uses: eProsima/eProsima-CI/external/checkout@v0
with:
path: src/fastdds_python

- name: Install apt dependencies
run: |
sudo apt update
sudo apt install -y \
python3 \
python3-pip \
swig \
libpython3-dev
- name: Install python dependencies
run: |
sudo pip3 install -U \
colcon-common-extensions \
colcon-mixin \
vcstool
colcon mixin add default https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml; colcon mixin update default
- uses: eProsima/eProsima-CI/ubuntu/install_apt_packages@v0
with:
packages: libpython3-dev swig

- uses: eProsima/eProsima-CI/ubuntu/install_python_packages@v0
with:
packages: vcstool

- uses: eProsima/eProsima-CI/ubuntu/install_colcon@feature/ccache

- name: Fetch repositories
run: |
vcs import --skip-existing src < src/fastdds_python/fastdds_python.repos
- name: Get minimum supported version of CMake
uses: lukka/get-cmake@latest
- uses: eProsima/eProsima-CI/external/get-cmake@feature/ccache
with:
cmakeVersion: 3.22.6
- name: Use cmake
run: cmake --version

- name: Setup ccache
uses: Chocobo1/setup-ccache-action@v1
uses: eProsima/eProsima-CI/external/setup-ccache-action@feature/ccache

- name: Build workspace
run: >
run: |
cmake --version
colcon build \
--event-handlers=console_direct+ \
--metas ./src/fastdds_python/.github/workflows/test.meta \
Expand Down
1 change: 0 additions & 1 deletion fastdds_python.repos
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,3 @@ repositories:
type: git
url: https://github.com/eProsima/IDL-Parser.git
version: master

2 changes: 1 addition & 1 deletion fastdds_python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ find_package(SWIG REQUIRED)
include(${SWIG_USE_FILE})
set(CMAKE_SWIG_FLAGS "")

find_package (Python3 COMPONENTS Interpreter Development REQUIRED)
find_package(Python3 COMPONENTS Interpreter Development REQUIRED)

find_package(fastcdr 2 REQUIRED)
find_package(fastrtps 2.12 REQUIRED)
Expand Down

0 comments on commit 3267b2f

Please sign in to comment.