-
Notifications
You must be signed in to change notification settings - Fork 1
58 lines (55 loc) · 1.77 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
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@v5
with:
python-version: '3.10'
- uses: pre-commit/[email protected]
with:
extra_args: --all-files
- uses: pre-commit-ci/[email protected]
if: always()
with:
msg: 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@v5
with:
python-version: '3.10'
- run: pip install -r requirements/ci.txt
- 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.10" \
-d nightly_deps="" \
-d related_projects="ScippNeutron" # Just to test the list.
- 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 py310
working-directory: ${{ env.DUMMYPROJECTPATH }}
- run: git add -A && tox -e static # Files should be added to be checked
working-directory: ${{ env.DUMMYPROJECTPATH }}
- run: tox -e docs
working-directory: ${{ env.DUMMYPROJECTPATH }}