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

[MNT] Add dependency caching in CI #197

Merged
merged 8 commits into from
Oct 20, 2024
Merged
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
22 changes: 18 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: Test and build mendeleev package

env:
POETRY_VERSION: 1.8.2

on:
push:
branches: [master]
Expand All @@ -24,24 +27,35 @@ jobs:

steps:
- uses: actions/checkout@v4

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

- name: Install and configure Poetry
uses: snok/install-poetry@v1
with:
version: 1.8.2
version: ${{ env.POETRY_VERSION }}
virtualenvs-create: true
virtualenvs-in-project: true

- name: Cache dependencies
id: cache-deps
uses: actions/cache@v4
with:
path: ./.venv
key: pydeps-${{ matrix.os }}-python${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }}

- name: Install dependencies
if: steps.cache-deps.outputs.cache-hit != 'true'
run: poetry install --with vis --no-interaction -v

- name: Lint and format with ruff
uses: pre-commit/[email protected]

- name: Test with pytest
run: |
source $VENV
pytest
run: poetry run pytest

deploy:
needs: test
Expand Down
Loading