-
Notifications
You must be signed in to change notification settings - Fork 64
121 lines (101 loc) · 3.15 KB
/
Copy pathci.yml
File metadata and controls
121 lines (101 loc) · 3.15 KB
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
---
name: ci
on:
push:
branches: [main]
paths:
- src/*
- tests/*
- integration_tests/*
- docs/*
- pyproject.toml
- setup.py
pull_request:
workflow_dispatch: ~
schedule:
- cron: "0 */6 * * *" # every 6 hours
jobs:
# Full suite on Linux + Python 3.14: unit tests, coverage, integration, e2e, docs.
test-linux-py314:
runs-on: ubuntu-latest
permissions:
contents: read
actions: read
checks: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.14"
- name: install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y openmpi-bin libopenmpi3 libopenmpi-dev
- name: install haddock3 with extra dependencies
run: pip install -e '.[mpi,dev,docs,notebooks]'
- name: run unit tests
run: >-
pytest -v --random-order tests/
--cov --cov-report=
- name: generate coverage report
run: |
coverage report
coverage xml
- uses: codacy/codacy-coverage-reporter-action@v1
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: ./coverage.xml
- name: run integration tests
run: >-
pytest -v --random-order integration_tests/
- name: run end to end tests
run: >-
pytest -v --random-order --no-cov end-to-end_tests/
- name: check if docs are buildable
continue-on-error: true
run: |
sphinx-apidoc -f -e -o docs/ src/haddock -d 1
sphinx-build docs haddock3-docs
# Run the remaining OSxPython combinations in parallel
test-matrix:
runs-on: ${{ matrix.os }}
permissions:
contents: read
actions: read
checks: write
strategy:
matrix:
# ubuntu-latest = linux-x86_64
# ubuntu-24.04-arm = linux-aarch64
# macos-latest = macos-arm64
os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest]
# Test only newest and oldest python version
# > versions in the middle are unlikely to have compatibility issues
python-version: ["3.9", "3.14"]
exclude:
# Already covered by test-linux-py314, don't run again
- os: ubuntu-latest
python-version: "3.14"
fail-fast: false
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: install system dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y openmpi-bin libopenmpi3 libopenmpi-dev
- name: install system dependencies (macOS)
if: runner.os == 'macOS'
run: |
brew install open-mpi
- name: install haddock3 with extra dependencies
run: pip install -e '.[mpi,dev,docs,notebooks]'
- name: run unit tests
run: >-
pytest -v --random-order tests/
- name: run integration tests
run: >-
pytest -v --random-order integration_tests/