-
Notifications
You must be signed in to change notification settings - Fork 6
97 lines (82 loc) · 2.95 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
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Pytest with Flake8
on: [push, pull_request]
jobs:
build:
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
python-version: ["3.12", "3.13"]
numpy_ver: ["latest"]
test_config: ["latest"]
include:
- python-version: "3.11"
numpy_ver: "1.24"
pandas_ver: "2.0"
scipy_ver: "1.10"
xarray_ver: "2022.12.0"
pysat_ver: "3.2"
cdflib_ver: "1.0.2"
os: ubuntu-latest
test_config: "SPEC0"
- python-version: "3.9"
numpy_ver: "1.23.5"
os: "ubuntu-20.04"
test_config: "Ops"
name: Python ${{ matrix.python-version }} on ${{ matrix.os }} with numpy ${{ matrix.numpy_ver }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Reinstall fortran on MacOS
if: ${{ matrix.os == 'macos-latest' }}
run: brew reinstall gcc
- name: Install Operational dependencies
if: ${{ matrix.test_config == 'Ops'}}
run: |
pip install --no-cache-dir numpy==${{ matrix.numpy_ver }}
pip install --upgrade-strategy only-if-needed .[test]
- name: Install SPEC0 dependencies
if: ${{ matrix.test_config == 'SPEC0'}}
run: |
pip install numpy==${{ matrix.numpy_ver }}
pip install pandas==${{ matrix.pandas_ver }}
pip install scipy==${{ matrix.scipy_ver }}
pip install xarray==${{ matrix.xarray_ver }}
pip install pysat==${{ matrix.pysat_ver }}
pip install cdflib==${{ matrix.cdflib_ver }}
pip install --upgrade-strategy only-if-needed .[test]
- name: Install standard dependencies
if: ${{ matrix.test_config == 'latest'}}
run: |
pip install .[test]
- name: Set up pysat
run: |
mkdir pysatData
python -c "import pysat; pysat.params['data_dirs'] = 'pysatData'"
- name: Test PEP8 compliance
run: flake8 . --count --select=D,E,F,H,W --show-source --statistics
- name: Evaluate complexity
run: flake8 . --count --exit-zero --max-complexity=10 --statistics
- name: Test with pytest
run: pytest
- name: Coveralls Parallel
uses: coverallsapp/github-action@v2
with:
flag-name: run-${{ join(matrix.*, '-') }}
parallel: true
finish:
name: Finish Coverage Analysis
needs: build
if: ${{ always() }}
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@v2
with:
parallel-finished: true