Ensure HTTP session is always closed #271
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: test & publish | |
on: | |
pull_request: ~ | |
push: | |
branches: | |
- master | |
jobs: | |
test: | |
name: Test python-${{ matrix.python-version }} on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
python-version: [3.7, 3.8, 3.9, '3.10', '3.11', '3.12'] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: "pip" | |
cache-dependency-path: setup.py | |
- name: Set up Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: "temurin" | |
java-version: 11 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pycodestyle unittest-xml-reporting | |
pip install . | |
- name: Test | |
run: python -m xmlrunner discover -v -o test-results/test/ | |
- name: Pycodestyle | |
run: pycodestyle cr8 | |
- name: Upload results to wacklig | |
env: | |
WACKLIG_TOKEN: ${{ secrets.WACKLIG_TOKEN }} | |
run: | | |
curl -s https://raw.githubusercontent.com/pipifein/wacklig-uploader/master/wacklig.py | python - --token "$WACKLIG_TOKEN" || echo "Upload to wacklig failed" | |
publish: | |
name: Build & publish package to pypi | |
needs: test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up python 3.7 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.7 | |
cache: "pip" | |
cache-dependency-path: setup.py | |
- name: Build package | |
run: | | |
python -m pip install twine wheel | |
python setup.py sdist bdist_wheel | |
twine check dist/*.tar.gz | |
- name: Publish package | |
uses: mfussenegger/gh-action-pypi-publish@63c35b2cc56443d44589efa87a970cc1895ce79a | |
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') | |
with: | |
user: __token__ | |
password: ${{ secrets.pypi }} |