CI: Fix coveralls

Broken by coveralls>=2.1.0
This commit is contained in:
Unrud 2020-07-23 19:12:20 +02:00
parent ac0cfeabb9
commit c8c330d481

View File

@ -21,7 +21,7 @@ jobs:
if: github.event_name == 'push' if: github.event_name == 'push'
env: env:
COVERALLS_PARALLEL: true COVERALLS_PARALLEL: true
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: | run: |
python -m pip install coveralls python -m pip install coveralls
python -m coveralls python -m coveralls
@ -34,19 +34,9 @@ jobs:
- uses: actions/setup-python@v2 - uses: actions/setup-python@v2
with: with:
python-version: 3.x python-version: 3.x
- name: Install Coveralls - name: Finish Coveralls parallel builds
run: python -m pip install coveralls
- name: Call Coveralls parallel builds webhook
shell: python
env: env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: | run: |
import json, os, sys python -m pip install coveralls
from urllib.request import Request, urlopen python -m coveralls --finish
from coveralls import Coveralls
_, job, _ = Coveralls.load_config_from_github()
data = json.dumps({'repo_token': os.environ.get('COVERALLS_REPO_TOKEN', ''),
'payload': {'status': 'done', 'build_num': job}}).encode()
headers = {'Content-type': 'application/json'}
with urlopen(Request('https://coveralls.io/webhook', data, headers)) as f:
sys.stderr.buffer.write(f.read() + b'\n')