@@ -92,11 +92,14 @@ jobs:
9292 # black and flake8 action. As pre-commit does not support user installs,
9393 # we set PIP_USER=0 to not do a user install.
9494 - name : Run pre-commit hooks
95+ id : pre-commit
9596 run : export PIP_USER=0; SKIP="no-commit-to-branch,black,flake8" pre-commit run --all-files
9697
9798 # Run black seperately as we don't want to reformat the files
9899 # just error if something isn't formatted correctly.
99100 - name : Check files with black
101+ id : black
102+ if : always() && (steps.pre-commit.outcome == 'success' || steps.pre-commit.outcome == 'failure')
100103 run : black . --check --diff --color
101104
102105 # Run flake8 and have it format the linting errors in the format of
@@ -108,6 +111,8 @@ jobs:
108111 # Format used:
109112 # ::error file={filename},line={line},col={col}::{message}
110113 - name : Run flake8
114+ id : flake8
115+ if : always() && (steps.pre-commit.outcome == 'success' || steps.pre-commit.outcome == 'failure')
111116 run : " flake8 \
112117 --format='::error file=%(path)s,line=%(row)d,col=%(col)d::\
113118 [flake8] %(code)s: %(text)s'"
@@ -162,12 +167,50 @@ jobs:
162167 # This is saved to ./.coverage to be used by codecov to link a
163168 # coverage report to github.
164169 - name : Run tests and generate coverage report
165- run : python -m pytest -n auto --dist loadfile --cov --disable-warnings -q
170+ id : run_tests
171+ run : python -m pytest tests -n auto --dist loadfile --cov --disable-warnings -q
166172
167- # This step will publish the coverage reports to codecov .io and
173+ # This step will publish the coverage reports to coveralls .io and
168174 # print a "job" link in the output of the GitHub Action
169- - name : Publish coverage report to codecov.io
170- run : python -m codecov
175+ - name : Publish coverage report to coveralls.io
176+ # upload coverage even if a test run failed
177+ # this is a test, and may be removed in the future
178+ if : always() && (steps.run_tests.outcome == 'success' || steps.run_tests.outcome == 'failure')
179+ # important that we don't fail the workflow when coveralls is down
180+ continue-on-error : true
181+ env :
182+ COVERALLS_REPO_TOKEN : ${{ secrets.GITHUB_TOKEN }}
183+ COVERALLS_FLAG_NAME : coverage-${{ runner.os }}-python-${{ env.PYTHON_VERSION }}
184+ COVERALLS_PARALLEL : true
185+ COVERALLS_SERVICE_NAME : github
186+ run : python -m coveralls
187+
188+ coveralls-finish :
189+ name : Indicate completion to coveralls.io
190+ runs-on : ubuntu-latest
191+ needs : test
192+ # we don't want to fail the workflow when coveralls is down
193+ continue-on-error : true
194+ # we always want to ensure we attempt to send a finish to coveralls
195+ if : always()
196+ steps :
197+ # Set up a consistent version of Python
198+ - name : Set up Python 3.9
199+ id : python
200+ uses : actions/setup-python@v2
201+ with :
202+ python-version : ' 3.9'
203+ - name : Coveralls Finished
204+ continue-on-error : true
205+ env :
206+ COVERALLS_REPO_TOKEN : ${{ secrets.GITHUB_TOKEN }}
207+ COVERALLS_SERVICE_NAME : github
208+ # NOTE: this has a small thing where this will not always be the same with the poetry.lock file
209+ # given how this is installed for one api request, its not worth pinning to me.
210+ # any bugs caused by this can be solved when they occur
211+ run : |
212+ python3 -m pip install --upgrade coveralls
213+ python3 -m coveralls --finish
171214
172215 artifact :
173216 name : Generate Artifact
0 commit comments