build: pin pypi-publish version #98
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
# This workflow uses actions that are not certified by GitHub. | |
# They are provided by a third-party and are governed by | |
# separate terms of service, privacy policy, and support | |
# documentation. | |
name: Lint and Tests PRs | |
on: | |
pull_request: | |
branches: | |
- 'main' | |
permissions: | |
contents: read | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
strategy: | |
matrix: | |
container: [ "python:3.8", "python:3.9", "python:3.10", "python:3.11" ] | |
container: | |
image: ${{ matrix.container }} | |
steps: | |
- name: Check out src from Git | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # this (and below) is needed to have setuptools_scm report the correct version | |
fetch-tags: true | |
- name: Cache virtualenvironment | |
uses: actions/cache@v3 | |
with: | |
path: ~/.venv | |
key: ${{ hashFiles('requirements.txt', 'requirements-dev.txt') }} | |
- name: Upgrade pip | |
run: pip install --upgrade pip | |
- name: Create and activate Virtualenv | |
run: | | |
pip install virtualenv | |
[ ! -d ".venv" ] && virtualenv .venv | |
. .venv/bin/activate | |
- name: Install dependencies | |
run: | | |
pip install ".[dev]" | |
- name: Install pypa/build | |
run: >- | |
python -m | |
pip install | |
build | |
--user | |
- name: Make sure dist folder is empty | |
run: >- | |
rm -rf dist/* | |
- name: Build a binary wheel and a source tarball | |
run: >- | |
python -m | |
build | |
--sdist | |
--wheel | |
--outdir dist/ | |
. | |
- name: Run black formatter check | |
run: black --check confidence | |
- name: Run flake8 formatter check | |
run: flake8 confidence | |
- name: Run type linter check | |
run: mypy confidence | |
- name: Run tests with pytest | |
run: pytest |