๐ 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, andpnpm.
๐ Key Impact
- ๐ฆ Multi-Runtime Preparation: Configures Python and Node.js runtimes in a single, surgical step.
- โก Intelligent Caching: Automatically manages
pipandnpmcaches 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/)