Skip to content

Commit 8dc24cb

Browse files
UV tests and CI
1 parent 637c027 commit 8dc24cb

11 files changed

Lines changed: 2078 additions & 522 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main, master]
6+
pull_request:
7+
branches: [main, master]
8+
workflow_dispatch:
9+
10+
jobs:
11+
lint:
12+
name: Lint and Format Check
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
18+
- name: Set up Python
19+
uses: actions/setup-python@v5
20+
with:
21+
python-version: "3.11"
22+
23+
- name: Install UV
24+
uses: astral-sh/setup-uv@v3
25+
26+
- name: Install dependencies
27+
run: |
28+
uv pip install --system ruff
29+
30+
- name: Run ruff format check
31+
run: ruff format --check .
32+
33+
- name: Run ruff linting
34+
run: ruff check .
35+
36+
test:
37+
name: Test
38+
runs-on: ubuntu-latest
39+
steps:
40+
- name: Checkout code
41+
uses: actions/checkout@v4
42+
43+
- name: Set up Python 3.11
44+
uses: actions/setup-python@v5
45+
with:
46+
python-version: "3.11"
47+
48+
- name: Install UV
49+
uses: astral-sh/setup-uv@v3
50+
51+
- name: Install dependencies
52+
run: |
53+
uv pip install --system -e ".[dev]"
54+
55+
- name: Run tests
56+
run: |
57+
pytest
58+
59+
test-package-install:
60+
name: Test Package Installation
61+
runs-on: ubuntu-latest
62+
steps:
63+
- name: Checkout code
64+
uses: actions/checkout@v4
65+
66+
- name: Set up Python
67+
uses: actions/setup-python@v5
68+
with:
69+
python-version: "3.11"
70+
71+
- name: Install UV
72+
uses: astral-sh/setup-uv@v3
73+
74+
- name: Install package
75+
run: |
76+
uv pip install --system -e .
77+
78+
- name: Test CLI availability
79+
run: |
80+
which gen-stac || echo "CLI not found in PATH, checking if it's installed..."
81+
python -c "from overture_stac import OvertureRelease, RegistryManifest; print('Package imports successfully')"
82+
83+
- name: Test imports
84+
run: |
85+
python -c "from overture_stac.overture_stac import OvertureRelease; print('OvertureRelease imported')"
86+
python -c "from overture_stac.registry_manifest import RegistryManifest; print('RegistryManifest imported')"
87+
88+
all-checks-pass:
89+
name: All Checks Pass
90+
needs: [lint, test, test-package-install]
91+
runs-on: ubuntu-latest
92+
if: always()
93+
steps:
94+
- name: Check if all jobs passed
95+
run: |
96+
if [ "${{ needs.lint.result }}" != "success" ] || \
97+
[ "${{ needs.test.result }}" != "success" ] || \
98+
[ "${{ needs.test-package-install.result }}" != "success" ]; then
99+
echo "One or more checks failed"
100+
exit 1
101+
fi
102+
echo "All checks passed!"
Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
name: Build STAC for Overture Release
1+
name: Publish STAC Catalog
22

33
on:
4-
54
# Allows you to run this workflow manually from the Actions tab
65
workflow_dispatch:
76

@@ -11,9 +10,14 @@ permissions:
1110
pages: write
1211
id-token: write
1312

13+
# Allow only one concurrent deployment
14+
concurrency:
15+
group: "pages"
16+
cancel-in-progress: false
17+
1418
jobs:
15-
# Single deploy job since we're just deploying
16-
deploy:
19+
build-and-deploy:
20+
name: Build and Deploy STAC Catalog
1721
environment:
1822
name: github-pages
1923
url: ${{ steps.deployment.outputs.page_url }}
@@ -23,25 +27,28 @@ jobs:
2327
uses: actions/checkout@v4
2428

2529
- name: Set up Python 3.11
26-
uses: actions/setup-python@v3
30+
uses: actions/setup-python@v5
2731
with:
2832
python-version: "3.11"
2933

34+
- name: Install UV
35+
uses: astral-sh/setup-uv@v3
36+
3037
- name: Install dependencies
3138
run: |
32-
python -m pip install --upgrade pip
33-
pip install -r requirements.txt
39+
uv pip install --system -e .
3440
35-
- name: Run STAC Builder
36-
run: python3 gen-all-release-stac.py
41+
- name: Build STAC Catalog
42+
run: |
43+
gen-stac --output public_releases
3744
3845
- name: Setup Pages
3946
uses: actions/configure-pages@v5
4047

4148
- name: Upload artifact
4249
uses: actions/upload-pages-artifact@v3
4350
with:
44-
path: 'public_releases'
51+
path: "public_releases"
4552

4653
- name: Deploy to GitHub Pages
4754
id: deployment

0 commit comments

Comments
 (0)