Skip to content

Commit a63791c

Browse files
committed
try mimicking mapchete core package github CI
1 parent 764dd54 commit a63791c

File tree

2 files changed

+78
-1
lines changed

2 files changed

+78
-1
lines changed
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3+
4+
name: Python package test
5+
6+
on:
7+
push:
8+
branches: [main]
9+
pull_request:
10+
branches: [main]
11+
schedule:
12+
- cron: '0 8 * * 1,4'
13+
14+
jobs:
15+
test:
16+
runs-on: ${{ matrix.os }}
17+
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
python-version: ["3.10", "3.11", "3.12"]
22+
os: ["ubuntu-24.04", "ubuntu-latest"]
23+
24+
steps:
25+
- uses: actions/checkout@v2
26+
27+
- name: Set up Python ${{ matrix.python-version }}
28+
uses: actions/setup-python@v2
29+
with:
30+
python-version: ${{ matrix.python-version }}
31+
32+
- name: Lint
33+
run: |
34+
python -m pip install pre-commit
35+
pre-commit run --show-diff-on-failure --all-files
36+
37+
- name: Install dependencies
38+
env:
39+
CURL_CA_BUNDLE: /etc/ssl/certs/ca-certificates.crt
40+
run: |
41+
sudo apt-add-repository -y ppa:ubuntugis/ubuntugis-unstable
42+
sudo apt-get -y update
43+
sudo apt-get install -y gdal-bin libgdal-dev libproj-dev libgeos-dev
44+
python -m pip install --upgrade pip wheel
45+
pip install -e .[complete]
46+
pip freeze
47+
48+
# run tests
49+
- name: run
50+
env:
51+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
52+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
53+
AWS_REQUEST_PAYER: ${{ variables.AWS_REQUEST_PAYER }}
54+
AWS_DEFAULT_REGION: ${{ variables.AWS_DEFAULT_REGION }}
55+
CDSE_S3_ACCESS_KEY: ${{ secrets.CDSE_S3_ACCESS_KEY }}
56+
CDSE_S3_ACCESS_SECRET: ${{ secrets.CDSE_S3_ACCESS_SECRET }}
57+
CURL_CA_BUNDLE: /etc/ssl/certs/ca-certificates.crt
58+
run: pytest -v --cov mapchete_eo --cov-report xml:coverage.xml --cov-report=term-missing:skip-covered
59+
60+
# report detailed coverage in PR comment
61+
- name: comment test coverage report on PR
62+
uses: MishaKav/pytest-coverage-comment@main
63+
with:
64+
pytest-xml-coverage-path: coverage.xml
65+
title: missing coverage
66+
badge-title: Test Coverage
67+
hide-badge: false
68+
hide-report: false
69+
create-new-comment: false
70+
hide-comment: false
71+
report-only-changed-files: false
72+
remove-link-from-badge: true
73+
74+
# this will let the workflow fail if coverage is below 100%
75+
# - name: Pytest coverage
76+
# run: coverage report --skip-covered --show-missing --fail-under 100

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ classifiers = [
1616
"Development Status :: 3 - Alpha",
1717
"Intended Audience :: Developers",
1818
"License :: OSI Approved :: MIT License",
19-
"Programming Language :: Python :: 3.9",
2019
"Programming Language :: Python :: 3.10",
20+
"Programming Language :: Python :: 3.11",
21+
"Programming Language :: Python :: 3.12",
2122
"Topic :: Scientific/Engineering :: GIS",
2223
]
2324
dependencies = [

0 commit comments

Comments
 (0)