-
Notifications
You must be signed in to change notification settings - Fork 101
140 lines (135 loc) · 4.56 KB
/
ci_test.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
name: CI Tests
on:
push:
# branches:
# - master
pull_request:
schedule:
# run every Monday at 6am UTC
- cron: '0 6 * * 1'
env:
SETUP_XVFB: True # avoid issues if mpl tries to open a GUI window
TOXARGS: '-v'
HYPOTHESIS_PROFILE: 'ci'
jobs:
ci-tests:
name: ${{ matrix.os }}, ${{ matrix.tox_env }}
runs-on: ${{ matrix.os }}
if: "!(contains(github.event.head_commit.message, '[skip ci]') || contains(github.event.head_commit.message, '[ci skip]'))"
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
python: '3.13'
tox_env: 'ephemeris_connection'
- os: ubuntu-latest
python: '3.13'
tox_env: 'black'
- os: ubuntu-latest
python: '3.13'
tox_env: 'py313-test-cov'
- os: ubuntu-latest
python: '3.13'
tox_env: 'notebooks'
# - os: ubuntu-latest
# python: '3.8'
# tox_env: 'docs'
# - os: ubuntu-latest
# python: '3.10'
# tox_env: 'py310-test-alldeps-cov'
# - os: macos-12
# python: '3.13'
# tox_env: 'py313-test'
# - os: windows-latest
# python: '3.8'
# tox_env: 'py38-test'
- os: ubuntu-latest
python: '3.9'
tox_env: 'oldestdeps'
# - os: ubuntu-latest
# python: '3.8'
# tox_env: 'codestyle'
# uncomment this if needed to run a single test quickly
# can specify OS and python versions
# - os: macos-12
# python: '3.12'
# tox_env: 'singletest'
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Install base dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox
- name: Install graphviz dependency
if: "endsWith(matrix.tox_env, 'build_docs')"
run: sudo apt-get -y install graphviz
- name: Install pandoc dependency
if: "endsWith(matrix.tox_env, 'docs')"
run: sudo apt-get -y install pandoc
- name: Print Python, pip, and tox versions
run: |
python -c "import sys; print(f'Python {sys.version}')"
python -c "import pip; print(f'pip {pip.__version__}')"
python -c "import tox; print(f'tox {tox.__version__}')"
- name: Run tests
run: tox -e ${{ matrix.tox_env }}
- name: Upload coverage to codecov
if: "endsWith(matrix.tox_env, '-cov')"
uses: codecov/codecov-action@v2
with:
files: coverage.xml
# - name: Publish docs as an artifact
# if: "endsWith(matrix.tox_env, 'docs')"
# uses: actions/upload-artifact@v2
# with:
# name: documentation
# path: .tox/docs_out/
macos-latest-py313:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Set-Up Python Env
uses: mamba-org/setup-micromamba@v1
with:
init-shell: bash
environment-name: pint
cache-environment: true
cache-downloads: true
create-args: >-
--platform osx-64
-c conda-forge
python=3.13
astropy
git
- name: Install base dependencies
shell: bash -el {0}
run: |
python -m pip install --upgrade pip
python -m pip install tox pytest hypothesis numdifftools pathos setuptools
- name: Print OS, machine info
shell: bash -el {0}
run: |
python -c "import os; print(f'os {os.uname()}')"
python -c "import platform; print(f'processor {platform.processor()}')"
python -c "import numpy as np; print(f'eps: {np.finfo(np.longdouble).eps}')"
- name: Print Python, pip, and tox versions
shell: bash -el {0}
run: |
python -c "import sys; print(f'Python {sys.version}')"
python -c "import pip; print(f'pip {pip.__version__}')"
python -c "import tox; print(f'tox {tox.__version__}')"
- name: Install PINT and requirements
shell: bash -el {0}
run: |
python -m pip install -r requirements.txt
python -m pip install -r requirements_dev.txt
python -m pip install --force-reinstall --no-deps .
- name: Run tests
shell: bash -el {0}
run: pytest -v --pyargs tests --reruns 5