Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix windows ccache [19657] #65

Merged
merged 9 commits into from
Oct 23, 2023
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
16 changes: 16 additions & 0 deletions .github/ci/ccache.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
$erroractionpreference = "stop"

$tag = (Invoke-WebRequest -Uri "https://api.github.com/repos/ccache/ccache/releases" -UseBasicParsing | ConvertFrom-Json)[0].tag_name
$name = (Invoke-WebRequest -Uri "https://api.github.com/repos/ccache/ccache/releases" -UseBasicParsing | ConvertFrom-Json)[0].name
$filename = "ccache-$name-windows-x86_64"
$tarball = "$filename.zip"

$outdir = $pwd.Path
$outdir = "$outdir\.github"
mkdir $outdir
$ProgressPreference = 'SilentlyContinue'
Invoke-WebRequest -Uri "https://github.com/ccache/ccache/releases/download/$tag/$tarball" -OutFile "$outdir\$tarball"

Add-Type -AssemblyName System.IO.Compression.FileSystem
[System.IO.Compression.ZipFile]::ExtractToDirectory("$outdir\$tarball", "$outdir")
Move-Item -Path "$outdir\$filename" -Destination "$outdir\ccache"
101 changes: 39 additions & 62 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,42 +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
- uses: eProsima/eProsima-CI/windows/install_openssl@v0

- name: install swig
- 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;
- uses: eProsima/eProsima-CI/external/setup-python@v0
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@v2
- uses: eProsima/eProsima-CI/multiplatform/install_python_packages@v0
with:
packages: pytest pywin32 vcstool

- uses: eProsima/eProsima-CI/multiplatform/install_colcon@v0

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

Expand All @@ -63,16 +44,21 @@ 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@v0
with:
cmakeVersion: 3.22.6
- name: Use cmake
run: cmake --version

- name: Setting ninja
id: ninja
if: github.event.schedule == ''
shell: pwsh
run: |
echo "cmake_generator=ninja" >> $Env:GITHUB_OUTPUT

- name: Setup ccache
uses: Chocobo1/setup-ccache-action@v1
uses: eProsima/eProsima-CI/external/setup-ccache-action@v0
with:
install_ccache: false
windows_compile_environment: msvc

- name: Build workspace
Expand All @@ -83,10 +69,10 @@ 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 `
--cmake-args -DCMAKE_C_COMPILER_LAUNCHER="${{ env.ccache_symlinks_path }}" `
-DCMAKE_CXX_COMPILER_LAUNCHER="${{ env.ccache_symlinks_path }}"
--mixin rel-with-deb-info ccache ${{ steps.ninja.outputs.cmake_generator }}

- name: Run tests
shell: pwsh
Expand All @@ -105,47 +91,38 @@ jobs:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v2
- 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 \
vcstool \
colcon-common-extensions
- uses: eProsima/eProsima-CI/ubuntu/install_apt_packages@v0
with:
packages: libpython3-dev swig

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

- uses: eProsima/eProsima-CI/multiplatform/install_colcon@v0

- 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@v0
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@v0

- name: Build workspace
run: >
run: |
cmake --version
colcon build \
--event-handlers=console_direct+ \
--metas ./src/fastdds_python/.github/workflows/test.meta \
--cmake-args \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
--mixin rel-with-deb-info ccache

- name: Run tests
run: |
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