Skip to content

Support for conda, venv or pyenv-virtualenv usage in cookiecutter #272

Support for conda, venv or pyenv-virtualenv usage in cookiecutter

Support for conda, venv or pyenv-virtualenv usage in cookiecutter #272

Workflow file for this run

name: Run Cookiecutter Tests
on:
workflow_dispatch:
inputs:
debug_enabled:
description: "Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)"
required: false
default: false
pull_request:
push:
branches:
- master
jobs:
run_test:
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
python-version: ["3.8", "3.9", "3.10", "3.11"]
runs-on: ${{ matrix.os }}
name: Run pytest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: test
channels: conda-forge,nodefaults
python-version: ${{ matrix.python-version }}
- name: Install Mac dependencies
if: runner.os == 'macOS'
run: |
brew install coreutils direnv
which python
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
conda config --remove channels defaults
conda config --add channels conda-forge
conda config --add channels nodefaults
$CONDA/bin/conda init bash
- name: Fix Conda permissions on macOS
if: runner.os == 'macOS'
run: sudo chown -R $UID $CONDA
- name: Install Linux dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update -y && sudo apt-get install -y direnv
which python
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
conda config --remove channels defaults
conda config --add channels conda-forge
conda config --add channels nodefaults
$CONDA/bin/conda init bash
- name: Build docs
run: |
cd docs
which python
python -m mkdocs build
- name: Git config
run: |
git config --global user.email [email protected]
git config --global user.name "Github Actions"
- name: "Set up SSH agent"
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: "Add GitHub to the SSH known hosts file"
run: |
for ip in $(dig @8.8.8.8 github.com +short); do \
ssh-keyscan github.com,$ip; \
ssh-keyscan $ip; \
done 2>/dev/null >> ~/.ssh/known_hosts
- name: Setup tmate session
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled }}
uses: mxschmitt/action-tmate@v3
with:
limit-access-to-actor: true
- name: Run pytest
run: |
which python
python -m pytest -vvv