fixup! fixup! Drop travis.yml, add .github/workflows #1
This file contains hidden or 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 and publish package | ||
| on: | ||
| push: | ||
| pull_request: | ||
| jobs: | ||
| test: | ||
| 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 | ||