-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (42 loc) · 1.39 KB
/
tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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