-
Notifications
You must be signed in to change notification settings - Fork 2
98 lines (95 loc) · 2.6 KB
/
testsuite.yaml
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
name: Tests
on:
pull_request:
workflow_dispatch:
jobs:
linter:
name: Linter
runs-on: ubuntu-latest
env:
ENV_NAME: linting
PYTHON: 3.8
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Setup Environment
run: |
pip install pre-commit
- name: Linting
run: |
pre-commit install
pre-commit run -a
datacache:
name: Cache Data
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
- name: cache-kernels
uses: actions/cache@v2
with:
path: ~/ap_cache
key: kernel_cache-${{ steps.date.outputs.date }}
- name: Download and cache
run: |
pip install astropy
python ./ci/cache_kernels.py save
if: steps.cache-kernels.outputs.cache-hit != 'true'
tests:
env:
ENV_NAME: tests
PYTHON: ${{ matrix.python-version }}
OS: ${{ matrix.os }}
needs: [datacache, linter]
name: Testing
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
- name: load-cache
uses: actions/cache@v2
with:
path: ~/ap_cache
key: kernel_cache-${{ steps.date.outputs.date }}
- name: load kernels
run: |
pip install astropy
python ./ci/cache_kernels.py load
- name: Install
run: |
pip install pytest pytest-cov
pip install .
- name: Run Tests
run: |
python -m pytest --cov=lunarsky --cov-config=.coveragerc --cov-report xml:./coverage.xml --junitxml=test-reports/xunit.xml
- uses: codecov/codecov-action@v2
if: matrix.os == 'ubuntu-latest' && success()
with:
token: ${{secrets.CODECOV_TOKEN}} #required
file: ./coverage.xml #optional