Add vector file statistics (#278) #1473
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build | |
on: | |
pull_request: | |
push: | |
branches: | |
- "main" | |
- "develop" | |
workflow_call: | |
concurrency: | |
# This will cancel outdated runs on the same pull-request, but not runs for other triggers | |
group: ${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
env: | |
# The only way to simulate if-else statement | |
CHECKOUT_BRANCH: ${{ github.event_name == 'schedule' && 'develop' || github.ref }} | |
jobs: | |
check-pre-commit-hooks: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout branch | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ env.CHECKOUT_BRANCH }} | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.8" | |
- uses: pre-commit/[email protected] | |
with: | |
extra_args: --all-files --verbose | |
check-code-mypy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout branch | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ env.CHECKOUT_BRANCH }} | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.8" | |
cache: pip # caching the entire environment is faster when cache exists but slower for cache creation | |
- name: Install packages | |
run: pip install -e .[DEV,ML] | |
- name: Run mypy | |
run: mypy eogrow | |
test-on-github: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: | |
- "3.8" | |
- "3.10" | |
- "3.11" | |
include: | |
# A flag marks whether full or partial tests should be run | |
# We don't run integration tests on pull requests from outside repos, because they don't have secrets | |
- python-version: "3.9" | |
full_test_suite: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }} | |
steps: | |
- name: Checkout branch | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ env.CHECKOUT_BRANCH }} | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: pip | |
- name: Install packages | |
run: | | |
sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable -y | |
sudo apt-get update | |
sudo apt-get install -y build-essential gdal-bin libgdal-dev graphviz proj-bin gcc libproj-dev libspatialindex-dev libboost-all-dev | |
export CPLUS_INCLUDE_PATH=/usr/include/gdal | |
export C_INCLUDE_PATH=/usr/include/gdal | |
pip install -e .[DEV,ML] | |
pip install gdal==$(gdal-config --version) | |
- name: Run fast tests | |
if: ${{ !matrix.full_test_suite }} | |
run: pytest -m "not integration" | |
- name: Run fast and chain integration tests, create code coverage | |
if: ${{ matrix.full_test_suite }} | |
run: | | |
sentinelhub.config \ | |
--sh_client_id "${{ secrets.SH_CLIENT_ID }}" \ | |
--sh_client_secret "${{ secrets.SH_CLIENT_SECRET }}" | |
if [ ${{ github.event_name }} == 'push' ]; then | |
pytest -m "chain or not integration" --cov --cov-report=term --cov-report=xml | |
else | |
pytest -m "chain or not integration" | |
fi | |
- name: Upload code coverage | |
if: ${{ matrix.full_test_suite && github.event_name == 'push' }} | |
uses: codecov/codecov-action@v3 | |
with: | |
files: coverage.xml | |
fail_ci_if_error: true | |
verbose: false | |
mirror-to-gitlab: | |
if: github.event_name == 'push' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Mirror + trigger CI | |
uses: SvanBoxel/gitlab-mirror-and-ci-action@master | |
with: | |
args: "https://git.sinergise.com/eo/code/eo-grow" | |
env: | |
GITLAB_HOSTNAME: "git.sinergise.com" | |
GITLAB_USERNAME: "github-action" | |
GITLAB_PASSWORD: ${{ secrets.GITLAB_PASSWORD }} | |
GITLAB_PROJECT_ID: "878" | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |