-
Notifications
You must be signed in to change notification settings - Fork 9
50 lines (46 loc) · 1.48 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
name: Python package
on: [pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- name: Checkout code
# uses: actions/checkout@v2
uses: nschloe/action-cached-lfs-checkout@v1
# Cache for LFS to limit usage of GitHub LFS monthly bandwidth
# See <https://github.com/actions/checkout/issues/165>
- name: Create LFS file list
run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id
- name: Restore LFS cache
uses: actions/cache@v2
id: lfs-cache
with:
path: .git/lfs
key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }}-v1
- name: Git LFS Pull
run: git lfs pull
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install system dependencies
run: |
sudo apt update
sudo apt install -y libhdf5-dev libnetcdf-dev retry --option="APT::Acquire::Retries=3"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[full]
- name: Test with pytest
run: |
pip install pytest
pip install coverage
coverage run -m pytest
- name: Submit coverage
if: ${{ matrix.python-version == '3.8' }}
run: |
pip install codecov
codecov --token=${{ secrets.CODECOV_TOKEN }}