Merge pull request #29 from scipp/fix_picking_events_for_multiple_tools #120
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
# SPDX-License-Identifier: BSD-3-Clause | |
# Copyright (c) 2023 Scipp contributors (https://github.com/scipp) | |
name: Mpltoolbox | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- '*' | |
pull_request: | |
branches: | |
- '*' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: '3.10' | |
- name: Install dependencies | |
run: | | |
which python | |
python -m pip install --upgrade pip | |
python -m pip install flake8 toml black[jupyter] build pytest | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
- name: Check black formatting | |
run: | | |
black --check --diff . | |
- name: Lint with flake8 | |
run: | | |
flake8 . --count --statistics | |
- name: Install docs requirements | |
run: | | |
pip install -r docs/requirements.txt | |
sudo apt install pandoc | |
ln -s $(pwd)/src/mpltoolbox . | |
- name: Run python tests | |
run: | | |
python -m pytest tests | |
- name: Build documentation | |
run: | | |
sphinx-build -b html docs/. docs/build | |
- name: Archive documentation artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: DocumentationHTML | |
path: docs/build | |
- name: Build a binary wheel and a source tarball | |
if: startsWith(github.ref, 'refs/tags') | |
run: | | |
python -m build --sdist --wheel --outdir dist/ . | |
- name: Publish to PyPI | |
if: startsWith(github.ref, 'refs/tags') | |
uses: pypa/[email protected] | |
with: | |
password: ${{ secrets.PYPI_API_TOKEN }} |