Skip to content

Commit

Permalink
Merge pull request #142 from iterative/devel
Browse files Browse the repository at this point in the history
  • Loading branch information
casperdcl authored Jul 28, 2023
2 parents 4f2576e + d52b1ad commit 2e017b1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 37 deletions.
36 changes: 2 additions & 34 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,38 +5,6 @@ on:
schedule: [{cron: '0 9 * * 1'}] # M H d m w (Mondays at 9:00)
workflow_dispatch:
jobs:
check:
if: github.event_name != 'pull_request' || !contains('OWNER,MEMBER,COLLABORATOR', github.event.pull_request.author_association)
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: set PYSHA
run: echo "PYSHA=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
- uses: actions/cache@v3
with:
path: ~/.cache/pre-commit
key: pre-commit|${{ env.PYSHA }}|${{ hashFiles('.pre-commit-config.yaml') }}
- run: pip install -U pre-commit
- uses: reviewdog/action-setup@v1
- if: github.event_name == 'push' || github.event_name == 'pull_request'
name: comment
run: |
if [[ $EVENT == pull_request ]]; then
REPORTER=github-pr-review
else
REPORTER=github-check
fi
pre-commit run -a todo | reviewdog -efm="%f:%l: %m" -name=TODO -tee -reporter=$REPORTER -filter-mode nofilter
pre-commit run -a flake8 | reviewdog -f=pep8 -name=flake8 -tee -reporter=$REPORTER -filter-mode nofilter
pre-commit run -a mypy | reviewdog -efm="%f:%l: %m" -name=mypy -tee -reporter=$REPORTER -filter-mode nofilter
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
EVENT: ${{ github.event_name }}
- run: pre-commit run -a --show-diff-on-failure
test:
if: github.event_name != 'pull_request' || !contains('OWNER,MEMBER,COLLABORATOR', github.event.pull_request.author_association)
name: Test py${{ matrix.python }}
Expand All @@ -56,7 +24,7 @@ jobs:
- run: pytest
- uses: codecov/codecov-action@v3
deploy:
needs: [check, test]
needs: test
name: PyPI Deploy
runs-on: ubuntu-latest
steps:
Expand All @@ -80,7 +48,7 @@ jobs:
tag="${GITHUB_REF#refs/tags/}"
gh release create --title "shtab $tag beta" --draft --notes "$changelog" "$tag" dist/${{ steps.dist.outputs.whl }} dist/${{ steps.dist.outputs.targz }}
env:
GH_TOKEN: ${{ github.token }}
GH_TOKEN: ${{ secrets.GH_TOKEN || github.token }}
- name: Docs
run: |
pushd docs
Expand Down
10 changes: 7 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ repos:
rev: v4.4.0
hooks:
- id: check-added-large-files
- id: check-builtin-literals
- id: check-case-conflict
- id: check-docstring-first
- id: check-executables-have-shebangs
- id: check-toml
- id: check-merge-conflict
- id: check-toml
- id: check-yaml
- id: debug-statements
- id: end-of-file-fixer
Expand Down Expand Up @@ -39,12 +40,12 @@ repos:
- flake8-pyproject
- flake8-string-format
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.3.0
rev: v1.4.1
hooks:
- id: mypy
additional_dependencies: [types-setuptools]
- repo: https://github.com/google/yapf
rev: v0.33.0
rev: v0.40.0
hooks:
- id: yapf
args: [-i]
Expand All @@ -53,3 +54,6 @@ repos:
rev: 5.12.0
hooks:
- id: isort
ci:
autoupdate_schedule: monthly
skip: [flake8]

0 comments on commit 2e017b1

Please sign in to comment.