-
Notifications
You must be signed in to change notification settings - Fork 950
60 lines (60 loc) · 2.01 KB
/
build-cache.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
---
name: update-cache
on:
push:
branches:
- master
jobs:
build-validate-cache:
name: Build Lint and Format Cache
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Setup Python
uses: actions/setup-python@v5
id: setup_python
with:
python-version: '3.9'
- name: cache virtualenv
uses: actions/cache@v4
id: cache-venv
with:
path: ${{ env.pythonLocation }}
key: ${{ runner.os }}-${{ steps.setup_python.outputs.python-version }}-${{ env.pythonLocation }}-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-${{ steps.setup_python.outputs.python-version }}-${{ env.pythonLocation }}-
- name: Install dependencies
shell: bash
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
if: steps.cache-venv.outputs.cache-hit != 'true'
build-pytest-cache:
name: Build PyTest Cache
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Setup Python
uses: actions/setup-python@v5
id: setup_python
with:
python-version: '3.9'
- name: cache virtualenv
uses: actions/cache@v4
id: cache-venv-pytest
with:
path: ${{ env.pythonLocation }}
key: ${{ runner.os }}-${{ steps.setup_python.outputs.python-version }}-${{ env.pythonLocation }}-pytest-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-${{ steps.setup_python.outputs.python-version }}-${{ env.pythonLocation }}-pytest-
- name: Install dependencies
shell: bash
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
python -m pip install pytest-github-actions-annotate-failures
if: steps.cache-venv-pytest.outputs.cache-hit != 'true'