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 7 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"
46 changes: 35 additions & 11 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,26 @@ jobs:
"System32;SysWoW64" -split ";" | Join-Path -Path $env:windir -ChildPath {$_} `
| ls -Include libssl-*.dll | rm

- name: install swig
- 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

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

- name: Install python build dependencies
shell: pwsh
run: >
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

- name: Install python tests dependencies
shell: pwsh
Expand All @@ -54,7 +66,7 @@ jobs:
}
& $python_exec -m pip install -U pytest pywin32

- uses: actions/checkout@v2
- uses: actions/checkout@v4
Copy link
Contributor

Choose a reason for hiding this comment

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

This can be updated to use the action wrapped in eprosima-CI repository. Thus, updating the external action would be enough to upgrade every eProsima workflow.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done in 2899e34

with:
path: src/fastdds_python

Expand All @@ -67,12 +79,25 @@ jobs:
uses: lukka/get-cmake@latest
with:
cmakeVersion: 3.22.6

- name: Use cmake
run: cmake --version

- name: Install ccache
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

- name: Setup ccache
uses: Chocobo1/setup-ccache-action@v1
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be nice to include this action into eProsima-CI external actions.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done in 2899e34

with:
prepend_symlinks_to_path: false
install_ccache: false
windows_compile_environment: msvc

- name: Build workspace
Expand All @@ -85,8 +110,7 @@ jobs:
-StartInPath (pwd) -DevCmdArguments '/arch=x64 /host_arch=x64';
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,7 +129,7 @@ jobs:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
path: src/fastdds_python

Expand All @@ -121,8 +145,10 @@ jobs:
- name: Install python dependencies
run: |
sudo pip3 install -U \
vcstool \
colcon-common-extensions
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

- name: Fetch repositories
run: |
Expand All @@ -143,9 +169,7 @@ jobs:
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