From 5591e767adf75f59ce6e8dd5d376c3d7617638c7 Mon Sep 17 00:00:00 2001 From: Raul Sanchez-Mateos Lizano Date: Tue, 16 Jul 2024 15:09:02 +0200 Subject: [PATCH] Check if python venv already exists in setup venv action (#114) * Check if python venv already exists in setup venv action Signed-off-by: Raul Sanchez-Mateos * Set action branches references to current branch Signed-off-by: Raul Sanchez-Mateos * Activate virtual environment even if exists Signed-off-by: Raul Sanchez-Mateos * Set cmake-utils version to download Signed-off-by: Raul Sanchez-Mateos * Update versions.md Signed-off-by: Raul Sanchez-Mateos * Update artifacts name in README Signed-off-by: Raul Sanchez-Mateos * Set action branches references back to main Signed-off-by: Raul Sanchez-Mateos --------- Signed-off-by: Raul Sanchez-Mateos --- README.md | 48 ++++++++++++++--------------- ubuntu/setup_python_venv/action.yml | 12 ++++++-- ubuntu/sphinx_docs/action.yml | 9 +++++- versions.md | 3 ++ 4 files changed, 44 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index 9019a629..f4f965c5 100644 --- a/README.md +++ b/README.md @@ -187,34 +187,34 @@ So far, the following workflows are running to upload artifacts: These are the artifacts that are generated every night with the latest versions of each project: - Fast DDS - - build_fastdds_ubuntu-22.04_Debug_nightly - - build_fastdds_ubuntu-22.04_Release_nightly - - build_fastdds_ubuntu-24.04_Debug_nightly - - build_fastdds_ubuntu-24.04_Release_nightly - - build_fastdds_windows-2019_Debug_nightly - - build_fastdds_windows-2019_Release_nightly - - build_fastdds_windows-2022_Debug_nightly - - build_fastdds_windows-2022_Release_nightly + - build_fastdds__ubuntu-22.04_Debug_nightly + - build_fastdds__ubuntu-22.04_Release_nightly + - build_fastdds__ubuntu-24.04_Debug_nightly + - build_fastdds__ubuntu-24.04_Release_nightly + - build_fastdds__windows-2019_Debug_nightly + - build_fastdds__windows-2019_Release_nightly + - build_fastdds__windows-2022_Debug_nightly + - build_fastdds__windows-2022_Release_nightly - dev-utils - - build_dev_utils_ubuntu-22.04_Debug_nightly - - build_dev_utils_ubuntu-22.04_Release_nightly - - build_dev_utils_ubuntu-24.04_Debug_nightly - - build_dev_utils_ubuntu-24.04_Release_nightly - - build_dev_utils_windows-2019_Debug_nightly - - build_dev_utils_windows-2019_Release_nightly - - build_dev_utils_windows-2022_Debug_nightly - - build_dev_utils_windows-2022_Release_nightly + - build_dev_utils__ubuntu-22.04_Debug_nightly + - build_dev_utils__ubuntu-22.04_Release_nightly + - build_dev_utils__ubuntu-24.04_Debug_nightly + - build_dev_utils__ubuntu-24.04_Release_nightly + - build_dev_utils__windows-2019_Debug_nightly + - build_dev_utils__windows-2019_Release_nightly + - build_dev_utils__windows-2022_Debug_nightly + - build_dev_utils__windows-2022_Release_nightly - DDS Pipe - - build_ddspipe_ubuntu-22.04_Debug_nightly - - build_ddspipe_ubuntu-22.04_Release_nightly - - build_ddspipe_ubuntu-24.04_Debug_nightly - - build_ddspipe_ubuntu-24.04_Release_nightly - - build_ddspipe_windows-2019_Debug_nightly - - build_ddspipe_windows-2019_Release_nightly - - build_ddspipe_windows-2022_Debug_nightly - - build_ddspipe_windows-2022_Release_nightly + - build_ddspipe__ubuntu-22.04_Debug_nightly + - build_ddspipe__ubuntu-22.04_Release_nightly + - build_ddspipe__ubuntu-24.04_Debug_nightly + - build_ddspipe__ubuntu-24.04_Release_nightly + - build_ddspipe__windows-2019_Debug_nightly + - build_ddspipe__windows-2019_Release_nightly + - build_ddspipe__windows-2022_Debug_nightly + - build_ddspipe__windows-2022_Release_nightly In order to use one of these artifacts, use the following action as a step: diff --git a/ubuntu/setup_python_venv/action.yml b/ubuntu/setup_python_venv/action.yml index e8a229d7..fda7fe87 100644 --- a/ubuntu/setup_python_venv/action.yml +++ b/ubuntu/setup_python_venv/action.yml @@ -22,9 +22,15 @@ runs: echo "::group::Setup Python virtual environment" - # Create a virtual environment - python3 -m venv ${{ inputs.path }} - source .venv/bin/activate + if [ -d "${{ inputs.path }}" ] && [ -f "${{ inputs.path }}/bin/activate" ]; then + echo "Virtual environment exists." + else + # Create a virtual environment + python3 -m venv ${{ inputs.path }} + fi + + # Activate the virtual environment + source ${{ inputs.path }}/bin/activate if [ "${{ inputs.activate_global }}" = "true" ]; then echo PATH=$PATH >> $GITHUB_ENV diff --git a/ubuntu/sphinx_docs/action.yml b/ubuntu/sphinx_docs/action.yml index 02bbc04f..87a33680 100644 --- a/ubuntu/sphinx_docs/action.yml +++ b/ubuntu/sphinx_docs/action.yml @@ -50,6 +50,13 @@ inputs: required: false default: '' + custom_version_build: + description: > + Version of Fast DDS build from eProsima-CI. + required: false + type: string + default: 'v2' + runs: using: composite steps: @@ -70,7 +77,7 @@ runs: - name: Download cmake_utils artifact uses: eProsima/eProsima-CI/multiplatform/download_dependency@main with: - artifact_name: build_dev_utils_ubuntu-22.04_Release_nightly + artifact_name: build_dev_utils_${{ inputs.custom_version_build }}_ubuntu-22.04_Release_nightly workflow_source: build_dev_utils.yml workflow_source_repository: eProsima/eProsima-CI target_workspace: '${{ github.workspace }}/install' diff --git a/versions.md b/versions.md index 6820edce..4e4e7561 100644 --- a/versions.md +++ b/versions.md @@ -36,6 +36,9 @@ The [Forthcoming](#forthcoming) section includes those features added in `main` The upcoming release will include the following **features**: +- Check if python venv already exists in `setup_python_venv` action. +- Set cmake-utils version to download in `sphinx_docs` action. + ## v0.22.0 - Update nightly builds to compile on Ubuntu 24.04.