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 7, 2024
1 parent 7c80bbb commit 6a61883
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions .github/workflows/doc-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,32 @@ jobs:
with:
python-version: '3.x'
cache: 'pip'
- name: Set PIPX_HOME
run: echo "PIPX_HOME=${{ github.workspace }}/.pipx" >> $GITHUB_ENV

- name: Cache pipx environments
uses: actions/cache@v3
with:
path: ${{ github.workspace }}/.pipx
# pipx is creating a cachedir.tag with unique
key: ${{ runner.os }}-pipx-${{ hashFiles('.pipx/.cache/CACHEDIR.TAG') }}
restore-keys: |
${{ runner.os }}-pipx-
- name: Make sure latest hatch is installed
run: pipx upgrade hatch || pipx install hatch

- name: Cache Hatch environments
uses: actions/cache@v3
with:
path: .hatch_envs
path: ${{ github.workspace }}/.hatch_envs
# hatch envs are described in pyproject.toml
key: ${{ runner.os }}-hatch-envs-${{ hashFiles('pyproject.toml') }}
restore-keys: |
${{ runner.os }}-hatch-envs-
- 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
run: echo "HATCH_ENV_TYPE_VIRTUAL_PATH=${{ github.workspace }}/.hatch_envs" >> $GITHUB_ENV

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

0 comments on commit 6a61883

Please sign in to comment.