-
Notifications
You must be signed in to change notification settings - Fork 48
144 lines (136 loc) · 4.28 KB
/
continuous-integration.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
name: CI
on:
push:
branches:
- main
pull_request:
concurrency:
# Cancel running job if another commit is pushed to the branch
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: build
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version:
- "3.10"
- "3.11"
- "3.12"
os:
- ubuntu-latest
- windows-latest
- macos-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Download uv (non-Windows)
if: ${{ runner.os != 'Windows' }}
run: curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Download uv (Windows)
if: ${{ runner.os == 'Windows' }}
run: irm https://astral.sh/uv/install.ps1 | iex
- name: Install package with dev requirements
run: uv pip install --system .[dev]
- name: Run pre-commit
run: pre-commit run --all-files
- name: Run pytest
run: pytest -Werror -s --block-network --cov pystac_client --cov-report term-missing
- name: Run coverage
run: coverage xml
- name: Upload All coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
fail_ci_if_error: false
min-versions:
name: min-versions
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Download uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Install dev requirements
run: uv pip install --system .[dev]
- name: Install with min requirements
run: uv pip install --system --resolution=lowest-direct --reinstall .
- name: Run pytest
run: pytest -Werror -s --block-network
docs:
name: docs
runs-on: ubuntu-latest
# Required shell entrypoint to have properly activated conda environment
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v4
- name: Setup Conda Environment
uses: conda-incubator/[email protected]
with:
miniforge-variant: Mambaforge
miniforge-version: latest
python-version: "3.10"
use-mamba: true
channel-priority: strict
environment-file: ./docs/environment.yml
activate-environment: pystac-client-docs
auto-activate-base: false
- name: Build docs
run: ./scripts/build-docs
pre-release:
name: pre-release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Download uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Install with dev requirements
run: uv pip install --system --pre .[dev]
- name: Install any pre-releases of pystac
run: uv pip install --system -U --pre pystac
- name: Run pytest
run: pytest -Werror -s --block-network
upstream:
name: upstream
runs-on: ubuntu-latest
if: github.event_name != 'pull_request'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Download uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Install
run: uv pip install --system .[dev]
- name: Install pystac from main
run: uv pip install --system --force-reinstall git+https://github.com/stac-utils/pystac.git
- name: Run pytest
run: pytest -Werror -s --block-network
dev-and-docs-requirements:
name: dev and docs requirements check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Download uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Install geos
run: sudo apt -y install libgeos-dev
- name: Install
run: uv pip install --system .[dev,docs]