CI: add a PYTHON_VERSION environment variable (#297)

This way the pip cache will be invalidate when we change the Python version.
This commit is contained in:
XhmikosR
2020-04-30 20:31:38 +03:00
committed by GitHub
parent 4d9810d533
commit 41abe92e24

View File

@@ -2,6 +2,7 @@ name: Build and Deploy
env:
CI: true
PYTHON_VERSION: '3.7'
on: [push, pull_request]
@@ -16,15 +17,15 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.7'
python-version: '${{ env.PYTHON_VERSION }}'
architecture: 'x64'
- name: Cache dependencies
uses: actions/cache@v1
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
key: ${{ runner.os }}-pip-${{ env.PYTHON_VERSION }}-${{ hashFiles('**/requirements.txt') }}
restore-keys: ${{ runner.os }}-pip-${{ env.PYTHON_VERSION }}-${{ hashFiles('**/requirements.txt') }}
- name: Install Python dependencies
run: python3 -m pip install -r requirements.txt