Skip to content

Commit

Permalink
Use pipx for hatch installation and cache its env
Browse files Browse the repository at this point in the history
  • Loading branch information
martinhoyer committed Oct 10, 2024
1 parent 6bb0e1c commit 27d3c27
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions .github/workflows/doc-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ on:
permissions:
contents: read

env:
HATCH_ENV_TYPE_VIRTUAL_PATH: ${{ github.workspace }}/.hatch_envs

jobs:
doc-test:
name: Sphinx Documentation Tests
Expand All @@ -23,19 +26,15 @@ jobs:
cache: 'pip'

- name: Cache Hatch environments
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: .hatch_envs
key: ${{ runner.os }}-hatch-envs-${{ hashFiles('pyproject.toml') }}
restore-keys: |
${{ runner.os }}-hatch-envs-
path: |
${{ github.workspace }}/.hatch_envs
key: hatch-envs-${{ hashFiles('pyproject.toml') }}

- name: Install hatch
run: pip install hatch

- name: Set HATCH_ENV_TYPE_VIRTUAL_PATH
run: echo "HATCH_ENV_TYPE_VIRTUAL_PATH=$(pwd)/.hatch_envs" >> $GITHUB_ENV

- name: Run sphinx html builder
# -W = warnings as error
run: hatch run docs:html -W
Expand Down

0 comments on commit 27d3c27

Please sign in to comment.