Merge pull request #126 from scipp/fix-flake8 #121
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: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
formatting: | |
name: Formatting and static analysis | |
runs-on: 'ubuntu-22.04' | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9' | |
- run: python -m pip install --upgrade pip | |
- run: python -m pip install -r requirements/ci.txt | |
- run: tox -e static | |
- uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
commit_message: Apply automatic formatting | |
tests: | |
name: Tests | |
needs: formatting | |
runs-on: 'ubuntu-22.04' | |
env: | |
DUMMYPROJECTPATH: './test-dummy' | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9' | |
- run: pip install copier | |
- run: pip install tox | |
- run: | | |
copier copy ./ ${DUMMYPROJECTPATH} \ | |
-l \ | |
-d description="Dummy project to test the template." \ | |
-d projectname="testdummy" \ | |
-d max_python="3.12" \ | |
-d min_python="3.9" \ | |
-d nightly_deps="" \ | |
-d related_projects="" | |
- run: git init # ``setuptools`` complains if it is not a git repository. | |
working-directory: ${{ env.DUMMYPROJECTPATH }} | |
- run: sed -i '/dependencies = \[/a\ "numpy"' pyproject.toml | |
working-directory: ${{ env.DUMMYPROJECTPATH }} | |
- run: tox -e deps | |
working-directory: ${{ env.DUMMYPROJECTPATH }} | |
- run: tox -e py39 | |
working-directory: ${{ env.DUMMYPROJECTPATH }} | |
- run: tox -e static | |
working-directory: ${{ env.DUMMYPROJECTPATH }} | |
- run: tox -e docs | |
working-directory: ${{ env.DUMMYPROJECTPATH }} |