Skip to content

Commit

Permalink
chore: update actions
Browse files Browse the repository at this point in the history
  • Loading branch information
phi-friday committed Feb 24, 2024
1 parent b00a770 commit 4d677fa
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 28 deletions.
36 changes: 25 additions & 11 deletions .github/workflows/check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: lint & test

on:
push:
branches: [dev, main]
branches: [dev]
pull_request:
branches: [dev, main]

Expand All @@ -16,23 +16,37 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Install poetry
run: |
pipx install poetry
poetry config installer.modern-installation false
poetry config virtualenvs.in-project true
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: poetry
cache-dependency-path: |
**/poetry.lock

- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true

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

- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: |
poetry install --all-extras --with=dev
poetry config installer.max-workers 10
poetry install --no-interaction --all-extras --with=dev
- name: Load cached pre-commit
id: cached-pre-commit-dependencies
uses: actions/cache@v4
with:
path: ~/.cache/pre-commit
key: precommit-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('.pre-commit-config.yaml') }}

- name: Code checks
run: |
Expand Down
26 changes: 16 additions & 10 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,32 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Install poetry
run: |
pipx install poetry
poetry config installer.modern-installation false
poetry config virtualenvs.in-project true
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: poetry
cache-dependency-path: |
**/poetry.lock

- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true

- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v4
with:
path: .venv
key: venv-doc-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}

- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: |
pip install dunamai
VERSION=$(dunamai from any --no-metadata --style pep440)
poetry version $VERSION
poetry install --with=docs
poetry install --no-interaction --with=docs
- name: Create docs
run: |
Expand Down
15 changes: 8 additions & 7 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,18 @@ jobs:
token: "${{ secrets.GITHUB_TOKEN }}"
fetch-depth: 0

- name: Install poetry
run: |
pipx install poetry
poetry config installer.modern-installation false
poetry config virtualenvs.in-project true
- name: Setup Python Env ${{ matrix.python-version }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true

- name: Install dependencies
run: pip install dunamai

Expand Down

0 comments on commit 4d677fa

Please sign in to comment.