Skip to content

Drop travis.yml, add .github/workflows #5

Drop travis.yml, add .github/workflows

Drop travis.yml, add .github/workflows #5

name: Test, build and publish package
on:
push:
pull_request:
jobs:
test:
name: Run tests
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install some dependencies for testing
run: python3 -m pip install flake8 flake8-bugbear flake8-import-order flake8-simplify flake8-bandit
- name: Install this plugin with pip, too
run: python3 -m pip install .
- name: Run tests
run: python3 -m unittest discover -s ./tests -v
build:
name: Build a distribution package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.x"
- name: Install pypa/build
run: python3 -m pip install build --user
- name: Build a binary wheel and a source tarball
run: python3 -m build
- name: Store the distribution packages
uses: actions/upload-artifact@v5
with:
name: python-package-distributions
path: dist/
publish-to-pypi:
name: Publish to PyPI
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
needs:
- build
- test
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/flake8-gl-codeclimate
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
steps:
- name: Download all the dists
uses: actions/download-artifact@v6
with:
name: python-package-distributions
path: dist/
- name: Publish distribution package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1