Skip to content

Incorporate ruff linter into CI pipeline (#297) #902

Incorporate ruff linter into CI pipeline (#297)

Incorporate ruff linter into CI pipeline (#297) #902

Workflow file for this run

name: CI
# Events that trigger workflow
on:
pull_request:
push:
branches:
- master
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+-[a-z]+.[0-9]+'
# Jobs can run sequentially or in parallel
jobs:
build-and-test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.9', '3.10', '3.11']
steps:
- name: Checkout pull request HEAD commit instead of merge commit
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install source package and dependencies
run: |
python -m pip install -e .[dev]
- name: Run linting
run: |
make lint
- name: Run unit tests
run: |
make test/unit
- name: run the integration tests
run: make test/integration
publish:
name: Build and publish to PyPI registry
if: startsWith(github.ref, 'refs/tags')
needs: build-and-test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.10
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: pip install build
run: |
python -m pip install build --user
- name: Build a binary wheel and a source tarball
run: |
python -m build --sdist --wheel --outdir dist/ .
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.pypi_token }}