@@ -14,31 +14,29 @@ jobs:
1414 with :
1515 fetch-depth : 0
1616 - uses : actions/setup-python@v2
17- with :
18- python-version : ' 3.x'
19- - name : set PYSHA
17+ - name : Prepare cache
2018 run : echo "PYSHA=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
2119 - uses : actions/cache@v1
2220 with :
2321 path : ~/.cache/pre-commit
2422 key : pre-commit|${{ env.PYSHA }}|${{ hashFiles('.pre-commit-config.yaml') }}
25- - name : Test
23+ - name : Dependencies
2624 run : |
27- pip install -U tox
28- tox -e setup.py
29- - name : Self install
30- run : pip install -U .[dev]
31- - name : Build
32- run : |
33- python setup.py sdist bdist_wheel
34- twine check dist/*
25+ pip install -U pre-commit
3526 - uses : reviewdog/action-setup@v1
3627 - if : github.event_name != 'schedule'
37- name : flake8
28+ name : Comment
3829 run : |
39- pre-commit run -a flake8 | reviewdog -f=pep8 -name=Format -tee -reporter=github-check -filter-mode nofilter
30+ if [[ $EVENT == pull_request ]]; then
31+ REPORTER=github-pr-review
32+ else
33+ REPORTER=github-check
34+ fi
35+ pre-commit run -a todo | reviewdog -efm="%f:%l: %m" -name=TODO -tee -reporter=$REPORTER -filter-mode nofilter
36+ pre-commit run -a flake8 | reviewdog -f=pep8 -name=flake8 -tee -reporter=$REPORTER -filter-mode nofilter
4037 env :
4138 REVIEWDOG_GITHUB_API_TOKEN : ${{ secrets.GITHUB_TOKEN }}
39+ EVENT : ${{ github.event_name }}
4240 - name : Lint
4341 run : pre-commit run -a --show-diff-on-failure
4442 test :
@@ -66,22 +64,25 @@ jobs:
6664 fi
6765 env :
6866 PYVER : ${{ matrix.python }}
69- CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
70- - name : Coveralls Parallel
71- uses : AndreMiras/coveralls-python-action@develop
72- with :
73- parallel : true
67+ COVERALLS_FLAG_NAME : py ${{ matrix.python }}
68+ COVERALLS_PARALLEL : true
69+ COVERALLS_SERVICE_NAME : github
70+ # coveralls needs explicit token
71+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
7472 finish :
7573 if : github.event_name != 'pull_request' || github.head_ref != 'devel'
7674 name : Coverage
7775 continue-on-error : ${{ github.event_name != 'push' }}
7876 needs : test
7977 runs-on : ubuntu-latest
8078 steps :
79+ - uses : actions/setup-python@v2
8180 - name : Coveralls Finished
82- uses : AndreMiras/coveralls-python-action@develop
83- with :
84- parallel-finished : true
81+ run : |
82+ pip install -U coveralls
83+ coveralls --finish || :
84+ env :
85+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
8586 deploy :
8687 if : github.event_name != 'pull_request' || github.head_ref != 'devel'
8788 name : Deploy
@@ -91,20 +92,16 @@ jobs:
9192 - uses : actions/checkout@v2
9293 with :
9394 fetch-depth : 0
94- - if : github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
95- uses : casperdcl/deploy-pypi@v1
95+ - uses : actions/setup-python@v2
96+ - id : dist
97+ uses : casperdcl/deploy-pypi@v2
9698 with :
9799 build : true
98- gpg_key : ${{ secrets.GPG_KEY }}
99100 password : ${{ secrets.PYPI_TOKEN }}
100- skip_existing : true
101- - id : collect_assets
102- name : Collect assets
101+ gpg_key : ${{ secrets.GPG_KEY }}
102+ upload : ${{ github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') }}
103+ - name : Changelog
103104 run : |
104- echo "::set-output name=asset_path::$(ls dist/*.whl)"
105- echo "::set-output name=asset_name::$(basename dist/*.whl)"
106- echo "::set-output name=asset_path_sig::$(ls dist/*.whl.asc 2>/dev/null)"
107- echo "::set-output name=asset_name_sig::$(basename dist/*.whl.asc 2>/dev/null)"
108105 git log --pretty='format:%d%n- %s%n%b---' $(git tag --sort=v:refname | tail -n2 | head -n1)..HEAD > _CHANGES.md
109106 - if : github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
110107 id : create_release
@@ -122,15 +119,15 @@ jobs:
122119 GITHUB_TOKEN : ${{ secrets.GH_TOKEN }}
123120 with :
124121 upload_url : ${{ steps.create_release.outputs.upload_url }}
125- asset_path : ${{ steps.collect_assets .outputs.asset_path }}
126- asset_name : ${{ steps.collect_assets .outputs.asset_name }}
122+ asset_path : dist/ ${{ steps.dist .outputs.whl }}
123+ asset_name : ${{ steps.dist .outputs.whl }}
127124 asset_content_type : application/zip
128125 - if : github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
129126 uses : actions/upload-release-asset@v1
130127 env :
131128 GITHUB_TOKEN : ${{ secrets.GH_TOKEN }}
132129 with :
133130 upload_url : ${{ steps.create_release.outputs.upload_url }}
134- asset_path : ${{ steps.collect_assets .outputs.asset_path_sig }}
135- asset_name : ${{ steps.collect_assets .outputs.asset_name_sig }}
131+ asset_path : dist/ ${{ steps.dist .outputs.whl_asc }}
132+ asset_name : ${{ steps.dist .outputs.whl_asc }}
136133 asset_content_type : text/plain
0 commit comments