diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4b1ad48..86ab4f0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,10 +20,24 @@ jobs: 3.12 3.13 3.14 + - name: Compute cache window + id: cache_window + run: | + week=$(date +%Y-W%U) + echo "week=$week" >> $GITHUB_OUTPUT + echo "Cache window: $week" + - name: Cache hatch envs + uses: actions/cache@v4 + with: + path: ~/.local/share/hatch + key: hatch-${{ runner.os }}-${{ steps.cache_window.outputs.week }}-${{ hashFiles('pyproject.toml') }} + restore-keys: | + hatch-${{ runner.os }}-${{ steps.cache_window.outputs.week }}- + hatch-${{ runner.os }}- - name: Install run: pip install hatch pyright .[test] - name: Run tests - run: hatch test --all --cover + run: hatch test --all --cover --parallel - name: Run static checks run: hatch run test:pyright - name: Upload coverage reports to Coveralls diff --git a/pyproject.toml b/pyproject.toml index 4f8ce43..abe8fa3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,7 +47,7 @@ version-file = "startle/_version.py" dependencies = [ "pytest", "pytest-cov", "pyright", "typing-extensions" ] [tool.hatch.envs.hatch-test] -dependencies = [ "pytest", "pytest-cov", "pyright", "typing-extensions" ] +dependencies = [ "pytest", "pytest-cov", "pytest-xdist", "pyright", "typing-extensions" ] args = ["-ra", "-q"] [[tool.hatch.envs.hatch-test.matrix]]