up version #43
Workflow file for this run
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: ci | |
on: | |
push: | |
branches: | |
- ci | |
- dev | |
- main | |
tags: | |
- "v*" | |
pull_request: | |
branches: | |
- ci | |
- dev | |
- main | |
jobs: | |
ci: | |
name: Python ${{ matrix.python-version }} | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [3.7, 3.8, 3.9, "3.10", 3.11, pypy3.9] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: setup python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: "pip" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -e .[dev] | |
- name: Run ruff | |
run: ruff --format=github . | |
- name: Run test | |
run: coverage run --source=ipware -m unittest discover | |
- name: Coveralls | |
run: coveralls --service=github | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
cache: 'pip' | |
- name: Install build tools | |
run: pip3 --quiet install --upgrade build wheel | |
- name: Build | |
run: python3 -m build . | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: artifacts | |
path: dist/* | |
if-no-files-found: error | |
retention-days: 7 | |
pypi-publish: | |
name: Publish | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/v') | |
permissions: | |
id-token: write # IMPORTANT: mandatory for trusted publishing | |
needs: | |
- build | |
- ci | |
steps: | |
- uses: actions/download-artifact@v3 | |
with: | |
name: artifacts | |
path: dist | |
- name: Publish build to PyPI | |
uses: pypa/[email protected] |