Skip to content

Commit

Permalink
Split build and tests jobs
Browse files Browse the repository at this point in the history
Signed-off-by: Raul Sanchez-Mateos <[email protected]>
  • Loading branch information
rsanchez15 committed Dec 17, 2024
1 parent c046ae9 commit b220682
Showing 1 changed file with 91 additions and 26 deletions.
117 changes: 91 additions & 26 deletions .github/workflows/reusable-windows-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ defaults:
shell: pwsh

jobs:
reusable-windows-ci:
reusable-windows-ci-build:
runs-on: windows-2022
strategy:
fail-fast: false
Expand Down Expand Up @@ -93,6 +93,92 @@ jobs:
with:
packages: vcstool xmlschema

- name: Fetch Fast DDS dependencies
uses: eProsima/eProsima-CI/multiplatform/vcs_import@v0
with:
vcs_repos_file: ${{ github.workspace }}\src\fastdds\fastdds.repos
destination_workspace: src
skip_existing: 'true'

- name: Fetch Fast DDS CI dependencies
uses: eProsima/eProsima-CI/multiplatform/vcs_import@v0
with:
vcs_repos_file: ${{ github.workspace }}\src\fastdds\.github\workflows\config\fastdds_test.repos
destination_workspace: src
skip_existing: 'true'

- name: Build
id: build
continue-on-error: false
uses: eProsima/eProsima-CI/windows/colcon_build@v0
with:
colcon_meta_file: ${{ github.workspace }}\src\fastdds\.github\workflows\config\fastdds_build.meta ${{ github.workspace }}\src\fastdds\.github\workflows\config\fastdds_test.meta
colcon_build_args: ${{ inputs.colcon-args }}
# The following Fast DDS CMake options need to be specified here instead of in the meta files
# because they vary from platform to platform
cmake_args_default: ${{ inputs.cmake-args }} -T ${{ matrix.vs-toolset }} -DTHIRDPARTY_Asio=FORCE -DTHIRDPARTY_TinyXML2=FORCE -DTHIRDPARTY_fastcdr=OFF -DTHIRDPARTY_UPDATE=ON -DFASTDDS_EXAMPLE_TESTS=ON -DEPROSIMA_EXTRA_CMAKE_CXX_FLAGS="/MP /WX"
cmake_build_type: ${{ inputs.cmake-config }}
workspace: ${{ github.workspace }}

- name: Upload build workspace
uses: eProsima/eProsima-CI/external/upload-artifact@v0
with:
name: build_workspace_${{ inputs.label }}
path: ${{ github.workspace }}

reusable-windows-ci-test:
runs-on: windows-2022
needs: reusable-windows-ci-build
strategy:
fail-fast: false
matrix:
vs-toolset:
- 'v142'
steps:
- name: Install Fix Python version
uses: eProsima/eProsima-CI/external/setup-python@v0
with:
python-version: '3.11'

- name: Get minimum supported version of CMake
uses: eProsima/eProsima-CI/external/get-cmake@v0
with:
cmakeVersion: '3.22.6'

- name: Install OpenSSL
uses: eProsima/eprosima-CI/windows/install_openssl@v0
with:
version: '3.1.1'

- name: Update OpenSSL environment variables
run: |
# Update the environment
if (Test-Path -Path $Env:ProgramW6432\OpenSSL)
{
"OPENSSL64_ROOT=$Env:ProgramW6432\OpenSSL" | Out-File $Env:GITHUB_ENV -Append -Encoding OEM
}
elseif (Test-Path -Path $Env:ProgramW6432\OpenSSL-Win)
{
"OPENSSL64_ROOT=$Env:ProgramW6432\OpenSSL-Win" | Out-File $Env:GITHUB_ENV -Append -Encoding OEM
}
elseif (Test-Path -Path $Env:ProgramW6432\OpenSSL-Win64)
{
"OPENSSL64_ROOT=$Env:ProgramW6432\OpenSSL-Win64" | Out-File $Env:GITHUB_ENV -Append -Encoding OEM
}
else
{
Write-Error -Message "Cannot find OpenSSL installation."
exit 1
}
- name: Install colcon
uses: eProsima/eProsima-CI/windows/install_colcon@v0

- name: Install Python dependencies
uses: eProsima/eProsima-CI/windows/install_python_packages@v0
with:
packages: vcstool xmlschema

- name: Update known hosts file for DNS resolver testing
if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-test') }}
run: |
Expand Down Expand Up @@ -121,32 +207,11 @@ jobs:
# Show the result
gc $hostfile
- name: Fetch Fast DDS dependencies
uses: eProsima/eProsima-CI/multiplatform/vcs_import@v0
with:
vcs_repos_file: ${{ github.workspace }}\src\fastdds\fastdds.repos
destination_workspace: src
skip_existing: 'true'

- name: Fetch Fast DDS CI dependencies
uses: eProsima/eProsima-CI/multiplatform/vcs_import@v0
with:
vcs_repos_file: ${{ github.workspace }}\src\fastdds\.github\workflows\config\fastdds_test.repos
destination_workspace: src
skip_existing: 'true'

- name: Build
id: build
continue-on-error: false
uses: eProsima/eProsima-CI/windows/colcon_build@v0
- name: Fetch build workspace
uses: actions/download-artifact@v4
with:
colcon_meta_file: ${{ github.workspace }}\src\fastdds\.github\workflows\config\fastdds_build.meta ${{ github.workspace }}\src\fastdds\.github\workflows\config\fastdds_test.meta
colcon_build_args: ${{ inputs.colcon-args }}
# The following Fast DDS CMake options need to be specified here instead of in the meta files
# because they vary from platform to platform
cmake_args_default: ${{ inputs.cmake-args }} -T ${{ matrix.vs-toolset }} -DTHIRDPARTY_Asio=FORCE -DTHIRDPARTY_TinyXML2=FORCE -DTHIRDPARTY_fastcdr=OFF -DTHIRDPARTY_UPDATE=ON -DFASTDDS_EXAMPLE_TESTS=ON -DEPROSIMA_EXTRA_CMAKE_CXX_FLAGS="/MP /WX"
cmake_build_type: ${{ inputs.cmake-config }}
workspace: ${{ github.workspace }}
name: build_workspace_${{ inputs.label }}
path: ${{ github.workspace }}

- name: Test
if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-test') }}
Expand Down

0 comments on commit b220682

Please sign in to comment.