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

WIP: Refactor workflows and add README badges #7

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
56 changes: 18 additions & 38 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,16 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 3
- name: Set up Python
uses: actions/setup-python@v4
- name: Install poetry, pre-commit and the dynamic-versioning plugin
run: |
pipx install poetry
poetry self add "poetry-dynamic-versioning[plugin]"
pipx install pre-commit
- uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: Install poetry and pre-commit
run: pip install --user poetry pre-commit
- name: cache poetry virtualenv
uses: actions/cache@v1
id: cache
with:
path: ~/.virtualenvs
key: poetry-${{ hashfiles('**/poetry.lock') }}
restore-keys: |
poetry-${{ hashfiles('**/poetry.lock') }}
- name: set poetry config
run: |
poetry config virtualenvs.in-project false
poetry config virtualenvs.path ~/.virtualenvs
- name: Setup environment
run: poetry install
if: steps.cache.outputs.cache-hit != 'true'
cache: 'poetry'
- run: poetry install
- name: Run pre-commit tests
run: pre-commit run --from-ref HEAD^ --to-ref HEAD
pytest:
Expand All @@ -38,26 +27,17 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: Install poetry
run: pip install --user poetry
- name: cache poetry virtualenv
uses: actions/cache@v1
id: cache
with:
path: ~/.virtualenvs
key: poetry-${{ hashfiles('**/poetry.lock') }}
restore-keys: |
poetry-${{ hashfiles('**/poetry.lock') }}
- name: set poetry config
fetch-depth: 3
- name: Install poetry, pre-commit and the dynamic-versioning plugin
run: |
poetry config virtualenvs.in-project false
poetry config virtualenvs.path ~/.virtualenvs
- name: Setup environment
run: poetry install
if: steps.cache.outputs.cache-hit != 'true'
pipx install poetry
poetry self add "poetry-dynamic-versioning[plugin]"
pipx install pre-commit
- uses: actions/setup-python@v4
with:
python-version: "3.9"
cache: 'poetry'
- run: poetry install
- name: Run PyTest
run: poetry run pytest -v