-
Notifications
You must be signed in to change notification settings - Fork 3
71 lines (61 loc) Β· 1.98 KB
/
pytest-python2.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: π§ͺ pytest (using π Python2)
on:
push:
branches:
- master
tags:
- run-pytest*
- py2-pytest*
- "*-[0-9]+.*"
pull_request:
branches:
- master
- devel
env:
PY_VERSION: 2.7.18
jobs:
pytest-python2:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: π Cache π¦ APT Packages
uses: awalsh128/[email protected]
with:
packages: xmlstarlet
version: 1.0
- name: π Cache pyenv installation
id: cache-pyenv
uses: actions/cache@v4
with:
path: /opt/hostedtoolcache/pyenv_root
key: "pyenv-${{ env.PY_VERSION }}-3"
- name: ππ§° Set up pyenv
id: setup-pyenv
uses: "gabrielfalcao/pyenv-action@v18"
with:
default: "${{ env.PY_VERSION }}"
# Store the `PYENV_ROOT` var *inside* the cached directory so it can be
# retrieved consistently (independent of pyenv being freshly installed
# or coming from the cache).
# NOTE: In case pyenv was extracted from the cache, it WILL NOT BE ADDED
# to the PATH environment variable! Any follow-up task has to take
# this into account and **ACTIVELY** use the PYENV_ROOT variable!
command: |
echo $PYENV_ROOT > /opt/hostedtoolcache/pyenv_root/.pyenv_root
if: steps.cache-pyenv.outputs.cache-hit != 'true'
- name: π΅ Identify PYENV_ROOT
id: pyenvroot
run: |
cat /opt/hostedtoolcache/pyenv_root/.pyenv_root
echo "PYENV_ROOT=$(cat /opt/hostedtoolcache/pyenv_root/.pyenv_root)" >> $GITHUB_ENV
- name: ππ Cache Python2 virtualenv
id: cache-py2-venv
uses: actions/cache@v4
with:
path: venv.py2
key: "venv-py-${{ env.PY_VERSION }}--${{ hashFiles('pyproject.toml') }}-2"
- name: π§ͺβ Run pytest-wrapper
run: scripts/py2-pytest.sh --cov -vv
env:
VENV_PATH: venv.py2
PY_VERSION: ${{ env.PY_VERSION }}