Don't use an interactive shell #138
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: CI | |
on: | |
push: | |
tags: ["release/v*"] | |
branches: ["master", "pyenv-actions"] | |
pull_request: | |
branches: ["master", "pyenv-actions"] | |
workflow_dispatch: | |
jobs: | |
test-with-pyenv-interactive: | |
name: "Pytest with pyenv virtualenv interactive" | |
runs-on: "ubuntu-latest" | |
steps: | |
- name: "Checkout repo" | |
uses: actions/checkout@v2 | |
- name: "Install pyenv" | |
uses: "gabrielfalcao/pyenv-action@v16" | |
- name: "Show available Python versions" | |
run: | | |
eval "$(pyenv init -)" | |
pyenv versions | |
pyenv shell system | |
git clone https://github.com/pyenv/pyenv-virtualenv.git $(pyenv root)/plugins/pyenv-virtualenv | |
- name: "Install dependencies" | |
run: | | |
python -m pip install --user --upgrade pip | |
pwd | |
ls | |
python -m pip install --user .[test] | |
- name: "Run Pytest" | |
run: | | |
python -m pytest tests | |
test-with-virtualenv-sh-interactive: | |
name: "Pytest with virtualenv-sh" | |
runs-on: "ubuntu-latest" | |
steps: | |
- name: "Checkout repo" | |
uses: actions/checkout@v2 | |
- name: "Set up Python" | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.9' | |
- name: "Install dependencies" | |
run: | | |
python -m pip install --user --upgrade pip | |
python -m pip install --user virtualenv | |
python -m pip install --user virtualenv-sh | |
echo '. ${HOME}/.local/bin/virtualenv-sh.bash' >> ${HOME}/.bashrc | |
echo 'WORKON_HOME=${HOME}/.virtualenvs' >> ${HOME}/.bashrc | |
pwd | |
ls | |
python -m pip install .[test] | |
- name: "Run Pytest" | |
run: | | |
export VENV_MANAGEMENT_INTERACTIVE_SHELL=yes | |
python -m pytest tests | |
test-with-virtualenvwrapper-interactive: | |
name: "Pytest with virtualenvwrapper interactive" | |
runs-on: "ubuntu-latest" | |
steps: | |
- uses: actions/checkout@v2 | |
- name: "Set up Python" | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.9' | |
- name: "Install dependencies" | |
run: | | |
python -m pip install --user --upgrade pip | |
python -m pip install --user virtualenvwrapper | |
echo '. ${HOME}/.local/bin/virtualenvwrapper.sh' >> ${HOME}/.bashrc | |
echo 'WORKON_HOME=${HOME}/.virtualenvs' >> ${HOME}/.bashrc | |
python -m pip install .[test] | |
- name: "Run Pytest" | |
run: | | |
export VENV_MANAGEMENT_INTERACTIVE_SHELL=yes | |
python -m pytest tests | |
test-with-virtualenvwrapper-and-venvwraprc-noninterative: | |
name: "Pytest with virtualenvwrapper and .venvwraprc" | |
runs-on: "ubuntu-latest" | |
steps: | |
- uses: actions/checkout@v2 | |
- name: "Set up Python" | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.9' | |
- name: "Install dependencies" | |
run: | | |
python -m pip install --user --upgrade pip | |
python -m pip install --user virtualenvwrapper | |
echo "echo 'About to run ~/.local/bin/virtualenvwrapper.sh'" >> ${HOME}/.venvwraprc | |
echo '. ${HOME}/.local/bin/virtualenvwrapper.sh' >> ${HOME}/.venvwraprc | |
echo 'WORKON_HOME=${HOME}/.virtualenvs' >> ${HOME}/.venvwraprc | |
python -m pip install .[test] | |
- name: "Run Pytest" | |
run: | | |
export VENV_MANAGEMENT_SETUP_FILEPATH=${HOME}/.venvwraprc | |
python -m pytest tests | |
test-with-virtualenvwrapper-and-venvwraprc-interactive: | |
name: "Pytest with virtualenvwrapper and .venvwraprc interactive" | |
runs-on: "ubuntu-latest" | |
steps: | |
- uses: actions/checkout@v2 | |
- name: "Set up Python" | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.9' | |
- name: "Install dependencies" | |
run: | | |
python -m pip install --user --upgrade pip | |
python -m pip install --user virtualenvwrapper | |
echo "echo 'About to run ~/.local/bin/virtualenvwrapper.sh'" >> ${HOME}/.venvwraprc | |
echo '. ${HOME}/.local/bin/virtualenvwrapper.sh' >> ${HOME}/.venvwraprc | |
echo 'WORKON_HOME=${HOME}/.virtualenvs' >> ${HOME}/.venvwraprc | |
python -m pip install .[test] | |
- name: "Run Pytest" | |
run: | | |
export VENV_MANAGEMENT_INTERACTIVE_SHELL=yes | |
export VENV_MANAGEMENT_SETUP_FILEPATH=${HOME}/.venvwraprc | |
python -m pytest tests | |
package: | |
name: "Build Package Distributions" | |
needs: | |
- test-with-virtualenv-sh-interactive | |
- test-with-virtualenvwrapper-interactive | |
- test-with-virtualenvwrapper-and-venvwraprc-noninterative | |
- test-with-virtualenvwrapper-and-venvwraprc-interactive | |
runs-on: "ubuntu-latest" | |
steps: | |
- uses: "actions/checkout@v2" | |
- uses: "actions/setup-python@v2" | |
with: | |
python-version: "3.9" | |
- name: "Build distribution" | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install build | |
python -m build | |
- name: "Check wheel contents" | |
run: | | |
python -m pip install check-wheel-contents | |
check-wheel-contents dist/*.whl | |
- name: "Check long description is renderable" | |
run: | | |
python -m pip install twine | |
python -m twine check dist/* | |
- name: Publish package | |
if: startsWith(github.ref, 'refs/tags/release/v') | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_API_TOKEN }} |