Attempt to fix IP display. #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Pylint | |
on: | |
push: | |
paths: | |
- 'taky/**' | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
outputs: | |
pylint-score: ${{ steps.pylint.outputs.score }} | |
cov-pct: ${{ steps.tests.outputs.cov-pct }} | |
steps: | |
- uses: actions/checkout@v2 | |
- id: setup-python | |
name: Set up Python 3.8 | |
uses: actions/setup-python@v1 | |
with: | |
python-version: 3.8 | |
- id: pip-cache | |
name: Cache pip | |
uses: actions/cache@v2 | |
with: | |
# This path is specific to Ubuntu | |
path: ~/.cache/pip | |
# Look to see if there is a cache hit for the corresponding requirements file | |
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
${{ runner.os }}- | |
- id: setup-deps | |
name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
[ -f "requirements.txt" ] && pip install -r requirements.txt | |
pip install pylint coverage | |
- id: pylint | |
name: Analyzing the code with pylint | |
run: | | |
python3 -c "from pylint.lint import Run; ret = Run(['taky'], do_exit=False); print('::set-output name=score::%.2f' % ret.linter.stats.global_note)" | |
- id: tests | |
name: Running unit tests, generating coverage | |
run: | | |
coverage run -m unittest || true | |
COV_PCT=$(coverage report --include="taky/**" | awk '/TOTAL/{ print $NF }') | |
echo "::set-output name=cov-pct::${COV_PCT}" | |
badges: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- id: shieldsio-pylint | |
name: Create the Pylint Badge | |
uses: schneegans/[email protected] | |
with: | |
auth: ${{ secrets.GIST_SECRET }} | |
gistID: b8b273c056ed05901cfc671070e875ed | |
filename: taky-pylint-shieldsio.json | |
label: pylint | |
message: ${{ needs.build.outputs.pylint-score }} | |
color: green | |
- id: shieldsio-coverage | |
name: Create the Coverage Badge | |
uses: schneegans/[email protected] | |
with: | |
auth: ${{ secrets.GIST_SECRET }} | |
gistID: c7e215b2645a1b63b07f12eff8f13fdb | |
filename: taky-coverage-shieldsio.json | |
label: coverage | |
message: ${{ needs.build.outputs.cov-pct }} | |
color: red |