Skip to content

Commit

Permalink
update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
zacharyburnett committed Mar 4, 2022
1 parent 31e0a58 commit 3436fad
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 15 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: load cached `~/.local`
- name: load cached Python installation
id: cache
uses: actions/cache@v2
with:
path: ~/.local
key: ${{ runner.os }}-python${{ matrix.python-version }}-${{ hashFiles('pyproject.toml', 'setup.*') }}
restore-keys: ${{ runner.os }}-python${{ matrix.python-version }}-
path: ${{ env.pythonLocation }}
key: lint-${{ runner.os }}-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml', 'setup.*') }}
- name: build wheel
run: pip wheel . -w dist --no-deps
- name: save wheel
Expand Down
32 changes: 21 additions & 11 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: load cached `~/.local`
- name: load cached Python installation
id: cache
uses: actions/cache@v2
with:
path: ~/.local
key: ${{ runner.os }}-python${{ matrix.python-version }}-${{ hashFiles('pyproject.toml', 'setup.*') }}
restore-keys: ${{ runner.os }}-python${{ matrix.python-version }}-
path: ${{ env.pythonLocation }}
key: lint-${{ runner.os }}-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml', 'setup.*') }}
- name: install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: pip install ".[development]"
- name: lint with flake8
run: |
Expand All @@ -45,16 +46,25 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: load cached `~/.local`
- name: load cached Python installation
id: cache
uses: actions/cache@v2
with:
path: ~/.local
key: ${{ runner.os }}-python${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('pyproject.toml', 'setup.*') }}
restore-keys: ${{ runner.os }}-python${{ matrix.python-version }}-
- name: install `pipwin` on Windows
if: contains(matrix.os, 'windows')
run: pip install pipwin
path: ${{ env.pythonLocation }}
key: test-${{ runner.os }}-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml', 'setup.*') }}
- name: install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: pip install ".[testing]"
- name: run tests
if: matrix.python-version != '3.x' || matrix.os != 'ubuntu-latest'
run: pytest --numprocesses auto
- name: run tests with coverage
if: matrix.python-version == '3.x' && matrix.os == 'ubuntu-latest'
run: pytest --numprocesses auto --cov . --cov-report xml:coverage.xml
- name: upload coverage to Codecov
if: matrix.python-version == '3.x' && matrix.os == 'ubuntu-latest'
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.xml
fail_ci_if_error: true

0 comments on commit 3436fad

Please sign in to comment.