Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ci): use action/cache #26

Merged
merged 9 commits into from
Mar 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .github/workflows/linters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,19 @@ jobs:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Prepare Cache
uses: actions/cache@v4
with:
# TODO Hashing the whole `pyproject.toml` isn't nice!
key: py3.12-hatch-${{ hashFiles('pyproject.toml') }}-lint
path: |
~/.cache/pip
~/.local/share/hatch

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: pip

- name: Install Dependencies
run: |
Expand Down
15 changes: 13 additions & 2 deletions .github/workflows/run-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,27 @@ jobs:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Prepare Cache
uses: actions/cache@v4
with:
# TODO Hashing the whole `pyproject.toml` isn't nice!
key: py${{ matrix.python-version }}-hatch-${{ hashFiles('pyproject.toml') }}-tests
path: |
~/.cache/pip
~/.local/share/hatch

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip

- name: Install Dependencies
run: |
pip install hatch

- name: Run tests
# NOTE Run tests per environment to avoid `default` environment activation
# when `hatch run test` running.
run: |
hatch run test
hatch run test.pytest.7x:test
hatch run test.pytest.8x:test