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

Refactor CI workflow and add composite action for virtual environment… #172

Merged
merged 3 commits into from
Oct 7, 2024

Conversation

astrogilda
Copy link
Owner

… setup

Pull Request Template

Description

This pull request refactors the Continuous Integration (CI) workflow for the tsbootstrap project to enhance efficiency, maintainability, and performance. Key changes include:

  • Introduction of a Composite Action: Created a reusable composite action (setup-venv) for setting up the Python virtual environment using uv. This eliminates redundant steps across multiple jobs and ensures consistency.
  • Implemented Caching: Added caching for pip dependencies using actions/cache@v4 to significantly reduce build times by reusing previously installed packages.
  • Job Renaming for Clarity: Renamed CI jobs to more descriptive names (Test Core Dependencies, Test Without Optional Dependencies, and Test With All Optional Dependencies) to improve readability and understanding.
  • Consistent Shell Usage: Standardized shell usage across different operating systems (bash for Linux/macOS and pwsh for Windows) to prevent environment-related issues.
  • Permission Optimization: Restricted workflow permissions to contents: read following the principle of least privilege, enhancing security.
  • Enhanced Documentation and Comments: Added detailed comments throughout the CI.yml and composite action files to aid future contributors in understanding the workflow and its components.

These improvements streamline the CI process, reduce maintenance overhead, and enhance the overall developer experience, ensuring that the tsbootstrap project remains robust and scalable.

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)
  • Refactoring (non-breaking change that improves code structure)

How Has This Been Tested?

The changes have been tested through the following steps:

  • CI Pipeline Execution:
    • Verified that all CI jobs (Test Core Dependencies, Test Without Optional Dependencies, Test With All Optional Dependencies, and Test Docs Build) execute successfully across multiple Python versions and operating systems.
    • Ensured that the caching mechanism effectively reduces build times by reusing pip dependencies.
  • Composite Action Validation:
    • Confirmed that the setup-venv composite action correctly installs uv, updates the PATH, and creates the virtual environment on both Windows and Linux/macOS runners.
    • Tested the virtual environment activation and dependency installation steps to ensure consistency and reliability.
  • Documentation Build:
    • Built the Sphinx documentation to ensure that the docs job runs without errors and uploads the built documentation as artifacts.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules

Additional Information (if applicable)

  • Error Resolution: Addressed the missing shell property error in the composite action by specifying the appropriate shell for each step.
  • Future Enhancements: Planning to monitor CI performance metrics to quantify the improvements brought by caching and further optimize the workflow based on feedback from contributors.

Add All Contributors Command

Remember to acknowledge your contributions, replace contribution_type with your contribution (code, doc, etc.):

@all-contributors please add @astrogilda  for code

@astrogilda astrogilda self-assigned this Oct 7, 2024
@astrogilda astrogilda force-pushed the update-ciyml-workflow branch from 5fa3f7a to ca1a623 Compare October 7, 2024 22:24
@astrogilda astrogilda merged commit 74492d5 into main Oct 7, 2024
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant