Skip to content

test(nodeenv): make the git-bash probe report why it failed #78

test(nodeenv): make the git-bash probe report why it failed

test(nodeenv): make the git-bash probe report why it failed #78

Workflow file for this run

name: Tests
on:
pull_request:
branches:
- master
- main
push:
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
- name: Run tests with tox
run: |
tox -e py$(echo ${{ matrix.python-version }} | tr -d '.')
- name: Run flake8
run: |
flake8 --extend-ignore=E127 nodeenv.py tests setup.py
activate-shells:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.14
uses: actions/setup-python@v5
with:
python-version: '3.14'
- name: Install shells
run: |
sudo apt-get update
sudo apt-get install -y zsh fish
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
- name: Run activation script tests
env:
NODEENV_REQUIRE_SHELLS: '1'
run: |
pytest tests/test_activate_shells.py -v
# The only job that builds real node environments: the tests marked
# `integration` are deselected everywhere else. Deliberately ubuntu
# only - the install path is also platform specific, so macOS and
# Windows coverage of it was given up here to keep the matrix fast.
integration:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.14
uses: actions/setup-python@v5
with:
python-version: '3.14'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
- name: Run integration tests
run: |
pytest -m integration tests/ -v
# The posix activate written on Windows is only useful in a shell that
# can source it, and `shell: bash` on a windows runner is git-bash -
# exactly the environment of issue #226.
git-bash:
runs-on: windows-latest
timeout-minutes: 10
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.14
uses: actions/setup-python@v5
with:
python-version: '3.14'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
- name: Run git-bash activation test
run: |
pytest -m integration -k git_bash tests/ -v
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.14
uses: actions/setup-python@v5
with:
python-version: '3.14'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
- name: Run tests with coverage
run: |
coverage run -p -m pytest -m 'not integration'
coverage report -m
coverage html
- name: Upload coverage report
uses: actions/upload-artifact@v4
if: always()
with:
name: coverage-report
path: coverage-html/