-
Notifications
You must be signed in to change notification settings - Fork 1
60 lines (57 loc) · 1.84 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# 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 }}