Skip to content

Tests

Tests #5

Workflow file for this run

name: Tests
on:
push:
branches: [ main ]
pull_request:
jobs:
test_pyenv:
runs-on: ubuntu-latest
name: Test with pyenv
steps:
- name: Install python build tools
# Ref: https://github.com/pyenv/pyenv/wiki#suggested-build-environment
run: |
sudo apt-get update -y
sudo apt-get install -y make build-essential libssl-dev zlib1g-dev \
libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm \
libncursesw5-dev xz-utils libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev ffmpeg
- name: Install pyenv
run: |
git clone https://github.com/pyenv/pyenv.git "$HOME/.pyenv"
PYENV_ROOT="$HOME/.pyenv"
PYENV_BIN="$PYENV_ROOT/bin"
echo "$PYENV_BIN" >> $GITHUB_PATH
echo "PYENV_ROOT=$PYENV_ROOT" >> $GITHUB_ENV
- name: Check pyenv version
run: |
pyenv --version
- name: Cache pyenv installed version
uses: actions/cache@v4
with:
path: ~/.pyenv/versions
key: ${{ runner.os }}-pyenv-3.11.10-b
# Doing this beforehand should make the test itself faster
- name: Preinstall Python 3.11.10
run: |
pyenv install -v 3.11.10
- name: Checkout
uses: actions/checkout@v4
- name: Test with pytest
run: |
python3 -m pip install pytest
python3 -m pytest -v