Skip to content

Commit

Permalink
fix: cache
Browse files Browse the repository at this point in the history
  • Loading branch information
Snoopy1866 committed Sep 11, 2024
1 parent 19dafe3 commit 8892574
Showing 1 changed file with 39 additions and 8 deletions.
47 changes: 39 additions & 8 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,59 @@ on:
- "main"
pull_request:

env:
PYTHON_VERSION: "3.12"

jobs:
setup:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: install dependencies
run: pip install -r requirements-dev.txt
python-version: ${{ env.PYTHON_VERSION }}
- name: Cache Dependencies
id: cache
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: pip-${{ runner.os }}-${{ hashFiles('requirements-dev.txt') }}
restore-keys: |
pip-${{ runner.os }}-
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
lint:
runs-on: ubuntu-latest
needs: setup
steps:
- name: run linter
run: black src
- name: Restore Cached Dependencies
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: pip-${{ runner.os }}-${{ hashFiles('requirements-dev.txt') }}
restore-keys: |
pip-${{ runner.os }}-
- name: Run Linter
run: |
black src
pytest:
runs-on: ubuntu-latest
needs: setup
steps:
- name: run tests
run: pytest
- name: Restore Cached Dependencies
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: pip-${{ runner.os }}-${{ hashFiles('requirements-dev.txt') }}
restore-keys: |
pip-${{ runner.os }}-
- name: Run Tests
run: |
pytest

0 comments on commit 8892574

Please sign in to comment.