-
Notifications
You must be signed in to change notification settings - Fork 4
147 lines (117 loc) · 3.63 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
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
name: ci
env:
GEMINI_CIROOT: ~/ci
CMAKE_BUILD_TYPE: Release
CMAKE_PREFIX_PATH: ~/libgem_gnu
HOMEBREW_NO_INSTALL_CLEANUP: 1
on:
push:
paths:
- "**.py"
- ".github/workflows/ci.yml"
- "src/gemini3d/libraries.json"
- "!scripts/**"
- "!example/**"
- "!Examples/**"
jobs:
lint:
runs-on: ubuntu-latest
timeout-minutes: 3
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.9", "3.10", "3.11", "3.12"]
include:
- os: macos-latest
python-version: "3.12"
- os: windows-latest
python-version: "3.12"
name: Lint ${{ matrix.os }} Python ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- run: python -m pip install -e .[lint]
timeout-minutes: 2
- run: flake8
- run: mypy
linux-macos:
strategy:
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12']
os: [ubuntu-latest]
include:
- os: macos-latest
python-version: '3.12'
runs-on: ${{ matrix.os }}
name: ${{ matrix.os }} Python ${{ matrix.python-version }}
env:
FC: gfortran-13
steps:
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
# always need this for requirements.cmake
- name: Checkout Gemini3D-External
uses: actions/checkout@v4
with:
repository: gemini3d/external
path: gemext
- name: Checkout GemGI (for simulation config.nml inputs)
uses: actions/checkout@v4
with:
repository: gemini3d/gemci
path: ${{ github.workspace }}/gemci
- name: Install Prereqs (Linux)
if: runner.os == 'Linux'
run: |
sudo apt update
sudo $(cmake -P gemext/scripts/requirements.cmake)
- name: Install Prereqs (Macos)
if: runner.os == 'macOS'
run: $(cmake -P gemext/scripts/requirements.cmake)
- name: Cache install Gemini3D-External
id: cache-gemext
uses: actions/cache@v4
with:
path: |
${{ env.CMAKE_PREFIX_PATH }}
key: ${{ runner.os }}-gemext-${{ hashFiles('gemext/cmake/libraries.json') }}
# weak check that gemini3d/external has changed since last cache update
- name: Non-Cache Install Gemini3D-External
if: steps.cache-gemext.outputs.cache-hit != 'true'
timeout-minutes: 15
run: |
cmake -Dmumps_only=true -Dfind=true -Dprefix=${{ env.CMAKE_PREFIX_PATH }} -P build.cmake
working-directory: gemext
- name: Checkout Gemini3D
if: steps.cache-gemext.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
repository: gemini3d/gemini3d
path: gemini3d
- name: non-cache Install Gemini3D
if: steps.cache-gemext.outputs.cache-hit != 'true'
timeout-minutes: 15
run: |
cmake -B build --install-prefix ${{ env.CMAKE_PREFIX_PATH }}
cmake --build build --parallel
cmake --install build
working-directory: gemini3d
- name: Git Checkout ${{ github.action_repository }}
uses: actions/checkout@v4
- name: Install Python packages
run: python -m pip install .[tests,plots]
timeout-minutes: 5
# transient CI download speed
- name: Unit and Integration Tests
run: pytest
timeout-minutes: 15
env:
GEMCI_ROOT: ${{ github.workspace }}/gemci
# codecov coverage
# - run: pip install codecov pytest-cov
# - run: pytest --cov --cov-report=xml
# - name: Upload coverage to Codecov
# uses: codecov/codecov-action@v1