forked from fitbenchmarking/fitbenchmarking
-
Notifications
You must be signed in to change notification settings - Fork 0
158 lines (152 loc) · 4.97 KB
/
main.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
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
name: 'Tests'
on:
push:
branches:
- 'master'
- 'release-**'
pull_request:
branches:
- 'master'
- 'release-**'
release:
types: [published]
schedule:
- cron: '0 9 * * Mon'
workflow_dispatch:
jobs:
default_system_linux:
name: Default System Tests (Linux)
if: github.event.repository.fork == false
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install python
uses: actions/setup-python@v5
with:
python-version: '3.12'
check-latest: true
- name: Install dependencies
run: |
python -m pip install .[bumps,DFO,minuit,SAS,numdifftools,lmfit,nlopt,paramonte]
python -m pip install --upgrade .[dev]
python -m pip install "numpy<2.0"
- name: Run tests
run: ci/system_tests_default.sh
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: default_system_tests
path: test-results/default_system_pytest.xml
full_system_linux:
name: Full System Tests (Linux)
if: github.event.repository.fork == false
runs-on: ubuntu-latest
container:
image: 'ghcr.io/fitbenchmarking/fitbenchmarking-extras:latest'
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo -HE --preserve-env=PATH $VIRTUAL_ENV/bin/pip install pybind11[global]
sudo -HE --preserve-env=PATH $VIRTUAL_ENV/bin/pip install .[bumps,DFO,gofit,minuit,SAS,numdifftools,lmfit,nlopt,paramonte,hogben]
sudo -HE --preserve-env=PATH $VIRTUAL_ENV/bin/pip install --upgrade .[dev]
sudo -HE --preserve-env=PATH $VIRTUAL_ENV/bin/pip install "numpy<2.0"
mkdir -p $MASTSIF
mkdir -p $PYCUTEST_CACHE
- name: Run tests
run: ci/system_tests.sh
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: full_system_tests
path: test-results/full_system_pytest.xml
full_unit_linux:
name: Full Unit Tests (Linux)
if: github.event.repository.fork == false
runs-on: ubuntu-latest
container:
image: 'ghcr.io/fitbenchmarking/fitbenchmarking-extras:latest'
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo -HE --preserve-env=PATH $VIRTUAL_ENV/bin/pip install pybind11[global]
sudo -HE --preserve-env=PATH $VIRTUAL_ENV/bin/pip install .[bumps,DFO,gofit,gradient-free,minuit,SAS,numdifftools,lmfit,nlopt,paramonte,hogben]
sudo -HE --preserve-env=PATH $VIRTUAL_ENV/bin/pip install --upgrade .[dev]
sudo -HE --preserve-env=PATH $VIRTUAL_ENV/bin/pip install "numpy<2.0"
mkdir -p $MASTSIF
mkdir -p $PYCUTEST_CACHE
sudo apt update
sudo apt install -y curl
- name: Run tests
run: |
ci/unit_tests.sh
- name: Submit coverage
if: always()
uses: coverallsapp/github-action@v2
with:
file: coverage.lcov
compare-sha: ${{ github.event.pull_request.base.sha }}
git-commit: ${{ github.event.pull_request.head.sha }}
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: full_unit_tests
path: test-results/full_unit_pytest.xml
default_unit_tests:
name: Default Unit Tests (Linux)
if: github.event.repository.fork == false
strategy:
fail-fast: false
matrix:
python: ['3.9', '3.12']
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
check-latest: true
- name: Install dependencies
run: |
python -m pip install .[bumps,DFO,gradient-free,minuit,SAS,numdifftools,lmfit,nlopt]
python -m pip install --upgrade .[dev]
python -m pip install "numpy<2.0"
- name: Run linux tests
if: runner.os == 'Linux'
run: ci/unit_tests_default.sh
- name: Upload test results
if: matrix.python == '3.12'
uses: actions/upload-artifact@v4
with:
name: default_unit_tests
path: test-results/default_unit_pytest.xml
publish-test-results:
name: Publish Test Results
if: github.event.repository.fork == false && always()
needs: [default_system_linux, full_system_linux, default_unit_tests, full_unit_linux]
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Publish test results
uses: EnricoMi/publish-unit-test-result-action@v2
with:
check_name: Unit & system test results
files: artifacts/**/*.xml