Skip to content

Commit 54f827e

Browse files
committed
- CI: Use templates
- LINT: Lint YAML files
1 parent e6fe7ae commit 54f827e

10 files changed

Lines changed: 64 additions & 131 deletions

File tree

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
contact_links:
23
- name: Ask questions
34
url: https://github.com/sertit/eosets/discussions/categories/q-a

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# package ecosystems to update and where the package manifests are located.
33
# Please see the documentation for all configuration options:
44
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5-
5+
---
66
version: 2
77
updates:
88
- package-ecosystem: 'github-actions'

.github/workflows/publish.yml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,31 @@
1+
---
12
name: Publish to PyPI
2-
33
on:
44
push:
55
tags:
6-
- "v*"
7-
workflow_dispatch:
8-
6+
- v*
7+
workflow_dispatch: null
98
jobs:
109
build-n-publish:
1110
name: Build and publish to PyPI
1211
runs-on: ubuntu-latest
1312
environment:
1413
name: release
1514
permissions:
16-
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
15+
# IMPORTANT: this permission is mandatory for trusted publishing
16+
id-token: write
1717
steps:
1818
- name: Checkout source
1919
uses: actions/checkout@v6
2020
with:
21-
# Get history and tags for SCM versioning to work
2221
fetch-depth: 0
2322
- name: Install the latest version of uv with cache enabled
2423
uses: astral-sh/setup-uv@v7
2524
with:
26-
version: "latest"
25+
# Get history and tags for SCM versioning to work
26+
version: latest
2727
enable-cache: true
2828
cache-dependency-glob: ""
29-
3029
- name: Check that the current version isn't already on PyPi
3130
run: |
3231
if [ "$(./get_pypi_latest_version.sh)" != "$(git describe --tags)" ]
@@ -36,9 +35,7 @@ jobs:
3635
echo "Current version is the latest version uploaded to PyPI"
3736
exit 1
3837
fi
39-
4038
- name: Build a binary wheel and a source tarball
4139
run: uvx --from build pyproject-build --sdist --wheel
42-
4340
- name: Publish distribution to PyPI
4441
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/test.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1+
---
12
name: Mirror and run GitLab CI
2-
3-
on: [ push ]
4-
3+
on:
4+
- push
55
jobs:
66
build:
77
runs-on: ubuntu-latest
@@ -12,7 +12,7 @@ jobs:
1212
- name: Mirror + trigger CI
1313
uses: SvanBoxel/gitlab-mirror-and-ci-action@master
1414
with:
15-
args: "https://${{ secrets.GITLAB_HOSTNAME }}/sertit/libraries/eosets"
15+
args: https://${{ secrets.GITLAB_HOSTNAME }}/sertit/libraries/eosets
1616
env:
1717
GITLAB_HOSTNAME: ${{ secrets.GITLAB_HOSTNAME }}
1818
GITLAB_USERNAME: ${{ secrets.GITLAB_USERNAME }}

.gitlab-ci.yml

Lines changed: 33 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -1,126 +1,59 @@
1+
---
12
stages:
23
- lint
34
- test
4-
55
variables:
66
EO_CONTAINERS: $REGISTRY_GITLAB/eo-containers
77
EOSETS_CHANGES: eosets/**/[^_]*.{py,xml}
8-
9-
lint:
10-
image: python:3.10-buster
11-
stage: lint
12-
script:
13-
- python -m pip install --upgrade pip
14-
- pip install ruff
15-
- ruff format && ruff check
16-
except:
17-
- tags
18-
19-
pytest:
20-
image: $EO_CONTAINERS:geo_latest
21-
stage: test
22-
variables:
23-
CI_EOSETS_USE_S3: "0"
24-
before_script:
25-
- python -m pip install --upgrade pip
26-
- pip install --ignore-installed PyYAML
27-
- pip install -r requirements.txt
28-
- pip install -e .
29-
script:
30-
- python -m pytest ci -v --durations=0 --cov-report term --cov-report html:${CI_PROJECT_DIR}/cov.html --cov=eosets --log-cli-level DEBUG --capture=tee-sys
31-
artifacts:
32-
paths:
33-
- ${CI_PROJECT_DIR}/cov.html
34-
coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+%)/'
35-
tags:
36-
- sertit
37-
- linux
38-
- high_memory
8+
include:
9+
- project: sertit/groupware
10+
file: /ci_templates/lint_3_10.yaml
11+
- project: sertit/groupware
12+
file: /ci_templates/pytest.yaml
13+
.rules_pytest:
3914
rules:
4015
- if: $CI_COMMIT_TAG
4116
when: never
42-
- if: '$CI_PIPELINE_SOURCE == "schedule"'
17+
- if: $CI_PIPELINE_SOURCE == "schedule"
4318
when: never
4419
- changes:
4520
- $EOSETS_CHANGES
4621
- ci/**/*.{py,xml}
4722
- .gitlab-ci.yml
48-
- pytest.ini
49-
needs: [ "lint" ]
50-
51-
pytest_s3:
52-
image: $EO_CONTAINERS:geo_latest
53-
stage: test
54-
variables:
55-
CI_EOSETS_USE_S3: "1"
56-
before_script:
57-
- python -m pip install --upgrade pip
58-
- pip install --ignore-installed PyYAML
59-
- pip install -r requirements.txt
60-
- pip install -e .
61-
script:
62-
- python -m pytest ci -v --durations=0 --cov-report term --cov-report html:${CI_PROJECT_DIR}/cov_s3.html --cov=eosets --log-cli-level DEBUG --capture=tee-sys
63-
artifacts:
64-
paths:
65-
- ${CI_PROJECT_DIR}/cov_s3.html
66-
coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+%)/'
23+
.pytest_tags:
6724
tags:
6825
- sertit
6926
- linux
7027
- high_memory
71-
rules:
72-
- if: $CI_COMMIT_TAG
73-
when: never
74-
- if: '$CI_PIPELINE_SOURCE == "schedule"'
75-
when: never
76-
- changes:
77-
- $EOSETS_CHANGES
78-
- ci/**/*.{py,xml}
79-
- .gitlab-ci.yml
80-
- pytest.ini
81-
needs: [ "lint" ]
82-
83-
84-
# Test with Python3.13
85-
pytest_end_to_end_313:
86-
image: $EO_CONTAINERS:geo_313_latest
87-
stage: test
28+
pytest:
29+
image: $EO_CONTAINERS:geo_latest
30+
extends:
31+
- .pytest
32+
- .rules_pytest
33+
- .pytest_tags
8834
variables:
8935
CI_EOSETS_USE_S3: "0"
90-
before_script:
91-
- python -m pip install --upgrade pip
92-
- pip install --ignore-installed PyYAML
93-
- pip install -r requirements.txt
94-
- pip install -e .
95-
script:
96-
- python -m pytest ci -v --durations=0 --cov-report term --cov=eosets --log-cli-level DEBUG --capture=tee-sys
97-
coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+%)/'
98-
tags:
99-
- sertit
100-
- linux
101-
- high_memory
102-
rules:
103-
- if: '$CI_PIPELINE_SOURCE == "schedule" && $SCHEDULE_NAME == "3.13"'
104-
when: always
105-
106-
# Test with Python 3.14
36+
PATH_TO_TEST: ci
37+
COV: eosets
38+
pytest_s3:
39+
image: $EO_CONTAINERS:geo_latest
40+
extends:
41+
- .pytest
42+
- .rules_pytest
43+
- .pytest_tags
44+
variables:
45+
CI_EOSETS_USE_S3: "1"
46+
PATH_TO_TEST: ci
47+
COV: eosets
10748
pytest_end_to_end_314:
10849
image: $EO_CONTAINERS:geo_314_latest
109-
stage: test
50+
extends:
51+
- .pytest
52+
- .pytest_tags
11053
variables:
11154
CI_EOSETS_USE_S3: "0"
112-
before_script:
113-
- python -m pip install --upgrade pip
114-
- pip install --ignore-installed PyYAML
115-
- pip install -r requirements.txt
116-
- pip install -e .
117-
script:
118-
- python -m pytest ci -v --durations=0 --cov-report term --cov=eosets --log-cli-level DEBUG --capture=tee-sys
119-
coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+%)/'
120-
tags:
121-
- sertit
122-
- linux
123-
- high_memory
55+
PATH_TO_TEST: ci
56+
COV: eosets
12457
rules:
125-
- if: '$CI_PIPELINE_SOURCE == "schedule" && $SCHEDULE_NAME == "3.14"'
58+
- if: $CI_PIPELINE_SOURCE == "schedule" && $SCHEDULE_NAME == "3.14"
12659
when: always

.pre-commit-config.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
1+
---
12
exclude: |
23
(?x)^(
34
docs/.*
45
)$
56
fail_fast: false
67
ci:
7-
autoupdate_schedule: monthly
8+
autoupdate_schedule: monthly
89
repos:
9-
1010
- repo: https://github.com/pre-commit/pre-commit-hooks.git
1111
rev: v6.0.0
1212
hooks:
1313
- id: check-json
1414
- id: check-yaml
15-
args: [ --allow-multiple-documents, --unsafe ]
15+
args:
16+
- --allow-multiple-documents
17+
- --unsafe
1618
- id: check-xml
1719
- id: check-added-large-files
18-
args: [ '--maxkb=1600' ]
19-
20+
args:
21+
- --maxkb=1600
2022
- repo: https://github.com/astral-sh/ruff-pre-commit
21-
# Ruff version.
2223
rev: v0.15.12
2324
hooks:
24-
# Run the linter.
2525
- id: ruff
26-
args: [ --fix ]
27-
# Run the formatter.
26+
args:
27+
- --fix
2828
- id: ruff-format

CHANGES.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
## 0.6.0 (2025-mm-dd)
44

55
- **ENH: Change logo**
6+
- CI: Use templates
7+
- LINT: Lint YAML files
68

79
## 0.5.0 (2025-05-05)
810

environment-doc.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: eosets-doc
23
channels:
34
- conda-forge

environment.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: eosets
23
channels:
34
- conda-forge

readthedocs.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
---
12
version: 2
2-
33
build:
44
os: ubuntu-22.04
55
apt_packages:
@@ -13,20 +13,18 @@ build:
1313
post_install:
1414
- mkdir -p $READTHEDOCS_OUTPUT
1515
- cd $READTHEDOCS_OUTPUT
16-
# JUPYTER_CACHE_URL does not contain "?dl=1" because readthedocs encloses the variable with "'" when it contains "?"
16+
# JUPYTER_CACHE_URL does not contain "?dl=1"
17+
# because readthedocs encloses the variable with "'" when it contains "?"
1718
- wget -O file.zip ${JUPYTER_CACHE_URL}"?dl=1"
1819
- unzip file.zip -d $READTHEDOCS_OUTPUT
19-
2020
python:
2121
install:
2222
- requirements: requirements-doc.txt
2323
- method: pip
2424
path: .
25-
26-
2725
# Build from the docs/ directory with Sphinx
2826
sphinx:
2927
configuration: docs/conf.py
30-
# Equivalent to -W and --keep-going => turn warnings into errors, keep going anyway but return an exit code 1
28+
# Equivalent to -W and --keep-going
29+
# => turn warnings into errors, keep going anyway but return an exit code 1
3130
fail_on_warning: false
32-

0 commit comments

Comments
 (0)