Skip to content

Commit

Permalink
Update .gitlab-ci file
Browse files Browse the repository at this point in the history
Our internal GitLab Unistra now contains a pytest and lint templates.
This commit update the .gitlab-ci file to use it.
  • Loading branch information
bastiencyr committed Feb 7, 2025
1 parent 96b3b34 commit a66c7dc
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 43 deletions.
69 changes: 26 additions & 43 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,13 @@ variables:
EO_CONTAINERS: $REGISTRY_GITLAB/eo-containers
SU_CHANGES: sertit/[^_]*.{py,xml}

lint:
image: python:3.9-buster
stage: lint
script:
- python -m pip install --upgrade pip
- pip install ruff
- ruff format && ruff check
except:
- tags
include:
- project: 'sertit/groupware'
file: '/ci_templates/lint_3_9.yaml'
- project: 'sertit/groupware'
file: '/ci_templates/pytest.yaml'

pytest:
image: $EO_CONTAINERS:geo_latest
stage: test
variables:
CI_SERTIT_USE_S3: "0"
before_script:
- python -m pip install --upgrade pip
- pip install --ignore-installed PyYAML
- pip install -e .[full]
script:
- python -m pytest -v --durations=0 --cov-report term --cov-report xml:cov.xml --cov=sertit ci --cov-config=.coveragerc --log-cli-level DEBUG --capture=sys
coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+%)/'
tags:
- sertit
- linux
- low_memory
.rules_pytest:
rules:
- if: $CI_COMMIT_TAG
when: never
Expand All @@ -41,28 +22,30 @@ pytest:
- ci/**/*.{py,xml}
- .gitlab-ci.yml
- pytest.ini
needs: [ "lint" ]

pytest:
image: $EO_CONTAINERS:geo_latest
extends:
- .pytest
- .rules_pytest
variables:
CI_SERTIT_USE_S3: "0"
COV: sertit
EXTRA_DEPENDENCIES: full
tags:
- sertit
- linux
- low_memory

pytest_s3:
extends:
- .pytest
- .rules_pytest
image: $EO_CONTAINERS:geo_latest
stage: test
before_script:
- python -m pip install --upgrade pip
- pip install --ignore-installed PyYAML
- pip install -e .[full]
script:
- python -m pytest -v --durations=0 --cov-report term --cov-report xml:cov.xml --cov=sertit ci --cov-config=.coveragerc --log-cli-level DEBUG --capture=sys
coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+%)/'
variables:
COV: sertit
EXTRA_DEPENDENCIES: full
tags:
- sertit
- linux
- low_memory
rules:
- if: $CI_COMMIT_TAG
when: never
- changes:
- $SU_CHANGES
- ci/**/*.{py,xml}
- .gitlab-ci.yml
- pytest.ini
needs: [ "lint" ]
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Release History

## 1.xx.x

- CI: Refactor `.gitlab-ci.yml` file with new GitLab templates

## 1.45.0 (2025-01-27)

- **ENH: Use `odc.geo.xr.crop` instead of `rio.clip` to make `rasters.crop` dask-compatible** ([#27](https://github.com/sertit/sertit-utils/issues/27))
Expand Down

0 comments on commit a66c7dc

Please sign in to comment.