Skip to content

๐Ÿ Action: Setup Environment

High-speed, multi-runtime preparation for Python and Node.js environments featuring intelligent dependency caching and custom installation logic.


[!IMPORTANT] The Setup Environment action reduces pipeline initialization overhead by up to 60%. It seamlessly prepares multiple runtimes in parallel while managing deep cache trees for pip, npm, poetry, and pnpm.

๐Ÿš€ Key Impact

  • ๐Ÿ“ฆ Multi-Runtime Preparation: Configures Python and Node.js runtimes in a single, surgical step.
  • โšก Intelligent Caching: Automatically manages pip and npm caches to reduce build times by up to 60%.
  • ๐Ÿ› ๏ธ Custom Installation: Override default install commands to support complex dependency trees (Poetry, Yarn, pnpm).
  • ๐Ÿ›ก๏ธ Environment Stability: Ensures a consistent, clean environment for reliable test execution across all runners.

๐Ÿ› ๏ธ Configuration

Input Required Default Description
python-version No - Python version to install (e.g., 3.11).
node-version No - Node.js version to install (e.g., 20).
python-install-command No (Table) Command to install Python dependencies.
node-install-command No (Table) Command to install Node.js dependencies.
python-cache No pip Cache strategy for Python: pip, poetry, etc.
node-cache No npm Cache strategy for Node: npm, yarn, pnpm.

โšก Quick Start

Drop this snippet into your workflow:

steps:
  - name: ๐Ÿ Prepare Environment
    uses: carlos-camara/qa-hub-actions/setup-environment@main
    with:
      python-version: "3.11"
      node-version: "20"
      python-cache: "pip"

[View Full Wiki](https://carlos-camara.github.io/qa-hub-actions/actions/setup-environment/)