Skip to content

Commit 3dd82d7

Browse files
committed
Fix pyenv in workflow.
1 parent 7f86caf commit 3dd82d7

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

.github/actions/unittests/action.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ runs:
3030

3131
- name: Verify installed Python version
3232
run: |
33+
export PYENV_ROOT="$HOME/.pyenv"
34+
export PATH="$PYENV_ROOT/bin:$PATH"
35+
eval "$(pyenv init --path)"
3336
ACTUAL=$(python -V)
3437
EXPECTED=${{ inputs.python-version }}
3538
echo "Python version installed: $ACTUAL"
@@ -41,17 +44,26 @@ runs:
4144

4245
- name: Install pipenv
4346
run: |
47+
export PYENV_ROOT="$HOME/.pyenv"
48+
export PATH="$PYENV_ROOT/bin:$PATH"
49+
eval "$(pyenv init --path)"
4450
python -m pip install --upgrade pip
4551
pip install pipenv
4652
shell: bash
4753

4854
- name: Setup virtual environment
4955
run: |
56+
export PYENV_ROOT="$HOME/.pyenv"
57+
export PATH="$PYENV_ROOT/bin:$PATH"
58+
eval "$(pyenv init --path)"
5059
pipenv --python ${{ inputs.python-version }} install --dev --deploy
5160
shell: bash
5261

5362
- name: Verify virtual environment uses python version ${{ inputs.python-version }}
5463
run: |
64+
export PYENV_ROOT="$HOME/.pyenv"
65+
export PATH="$PYENV_ROOT/bin:$PATH"
66+
eval "$(pyenv init --path)"
5567
if pipenv run python -V | grep -q "${{ inputs.python-version }}"; then
5668
echo "Python ${{ inputs.python-version }} is being used."
5769
else
@@ -62,5 +74,8 @@ runs:
6274

6375
- name: Run unittests
6476
run: |
77+
export PYENV_ROOT="$HOME/.pyenv"
78+
export PATH="$PYENV_ROOT/bin:$PATH"
79+
eval "$(pyenv init --path)"
6580
PYTHONPATH=./src:./tests pipenv run pytest ./tests
6681
shell: bash

0 commit comments

Comments
 (0)