Skip to content

Commit 1f999de

Browse files
committed
ci: migrate ci to uv-based workflows
ci: add automatic PR Labeler ci: migrate build matrix to uv ci: retire python 3.8 build, since it is not compatible with pyproject.toml New pyproject.toml would need to add back the [tool.poetry], whci hwill hold redundant/duplicate info, with respect to the new section [project], so we avoid that. ci: migrate to uv-based Docs Build ci: disable '-n auto' pytest flag
1 parent b4a3952 commit 1f999de

5 files changed

Lines changed: 208 additions & 19 deletions

File tree

.github/labeler.yml

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
# Pull Request Labeling Rules based on changed files
2+
# https://github.com/actions/labeler
3+
4+
5+
####### LABELS based on FILE CHANGES #######
6+
7+
# Here, we declare Rules for Labeling PR based on the file changes
8+
9+
# Each Label is added, when their Rule(s) are True
10+
# - 'any' block is True, if any of the conditions are True
11+
# - 'all' block is True, if all of the conditions are True
12+
13+
# Typically a Label, only features one of 'any' or 'all' block
14+
15+
# Each label declares Rules that are mutually exclusive, in boolean logic.
16+
# Thus, the set of matching file paths are non-overlapping, across the labels.
17+
18+
19+
### SRC ###
20+
# Add 'business_logic' label to any change within the 'src/software_patterns' dir
21+
business_logic:
22+
- any:
23+
- changed-files:
24+
- any-glob-to-any-file:
25+
- 'src/software_patterns/*'
26+
- 'src/software_patterns/*'
27+
28+
stubs:
29+
- any:
30+
- changed-files:
31+
- any-glob-to-any-file: ['src/stubs/*', 'src/stubs/**/*']
32+
33+
### TESTS ###
34+
## Add 'test' label to any change within the 'tests' dir #
35+
test:
36+
- any:
37+
- changed-files:
38+
- any-glob-to-any-file:
39+
- 'tests/*'
40+
- 'tests/**/*'
41+
42+
# exclude any changes within the 'tests/data/' dir
43+
- all:
44+
- changed-files:
45+
- all-globs-to-all-files:
46+
- '!tests/data/*'
47+
- '!tests/data/**/*'
48+
49+
test_data:
50+
- any:
51+
- changed-files:
52+
- any-glob-to-any-file: ['tests/data/*', 'tests/data/**/*']
53+
54+
### DOCS ###
55+
# Any change within the 'docs' dir, or the '.readthedocs.yml' file
56+
docs:
57+
- any:
58+
- changed-files:
59+
- any-glob-to-any-file:
60+
- 'docs/*'
61+
- 'docs/**/*'
62+
- 'mkdocs.yml'
63+
- '.readthedocs.yml'
64+
- 'README.rst'
65+
- 'README.md'
66+
67+
### SCRIPTS ###
68+
scripts:
69+
- any:
70+
- changed-files:
71+
- any-glob-to-any-file:
72+
- 'scripts/**'
73+
74+
### CI ###
75+
# Add 'ci' label to any change within the '.github' dir
76+
ci:
77+
- any:
78+
- changed-files:
79+
- any-glob-to-any-file: ['.github/*', '.github/**/*']
80+
81+
### DOCKER ###
82+
docker:
83+
- any:
84+
- changed-files:
85+
- any-glob-to-any-file:
86+
- 'Dockerfile'
87+
- 'docker-compose.yml'
88+
- 'docker-compose.*.yml'
89+
- '.dockerignore'
90+
91+
### BUILD ###
92+
build:
93+
- any:
94+
- changed-files:
95+
- any-glob-to-any-file:
96+
- 'uv.lock'
97+
# - 'pyproject.toml'
98+
99+
### TOX ###
100+
tox:
101+
- any:
102+
- changed-files:
103+
- any-glob-to-any-file:
104+
- 'tox.ini'
105+
106+
config:
107+
- any:
108+
- changed-files:
109+
- any-glob-to-any-file:
110+
- '.bettercodehub.yml'
111+
- '.coveragerc'
112+
- '.gitignore'
113+
- '.prospector.yml'
114+
- '.pylintrc'
115+
116+
117+
####### LABELS based on BRANCH NAME #######
118+
119+
## Pull Request Labeling Rules based Base Branch
120+
121+
# Add 'release' label to any PR that is opened against the `main` branch
122+
release:
123+
- base-branch: 'main'
124+
125+
# Add 'boarding_auto' label to any PR that is opened against the `boarding-auto` branch
126+
# [GITOPS]: This should act as a signal, ie for a Listener Workflow to Merge the PR
127+
boarding_auto:
128+
- base-branch: ['^boarding-auto', 'boarding-auto']
129+
- base-branch: ['^board-n-release', 'board-n-release']
130+
131+
132+
# Add 'feature' label to any PR where the head branch name starts with
133+
# `feature` or has a `feature` section in the name
134+
feature:
135+
- head-branch: ['^feature', 'feature']

.github/workflows/cicd.yml

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,22 @@ jobs:
1717
# RUN TEST SUITE ON ALL PLATFORMS
1818
test_n_build:
1919
if: ${{ vars.TEST_JOB_ON != 'false' && !contains(github.event.head_commit.message, '_CI_SKIP_') }}
20-
uses: boromir674/automated-workflows/.github/workflows/test_build.yml@develop
20+
uses: boromir674/automated-workflows/.github/workflows/python-build.yml@develop
2121
with:
22-
# Spawn Job per combination of factors in JOB_MATRIX
23-
# Python 3.7 has reached End of Life (EOL) on June 27th, 2023
24-
# Python 3.12 is in bugfix mode, same as 3.11 -> can start supporting 3.12 it
25-
job_matrix: '{"platform": ["ubuntu-latest"], "python-version": ["3.10", "3.11", "3.12"]}'
26-
build_installation: 'wheel' # Verify sdist and wheel installations/"builds" against Tests
27-
# typecheck_policy: '1' # {0: Skip, 1: Run, 2: Run and allow failures}
28-
# run_policy: '0' # Force skip of downstream 'test_build' Test Job
29-
# artifact_name: 'BUILD_ARTIFACT'
22+
job_matrix: "{\"platform\": [\"ubuntu-latest\", \"macos-latest\"], \"python-version\": [\"3.9\", \"3.10\", \"3.11\", \"3.12\"]}"
23+
distribute_tests: false # avoid perf decrease due to test distribution overhead
24+
# tests are too fast so cpu distribution overhead increases total test execution time
25+
26+
# uses: boromir674/automated-workflows/.github/workflows/test_build.yml@develop
27+
# with:
28+
# # Spawn Job per combination of factors in JOB_MATRIX
29+
# # Python 3.7 has reached End of Life (EOL) on June 27th, 2023
30+
# # Python 3.12 is in bugfix mode, same as 3.11 -> can start supporting 3.12 it
31+
# job_matrix: '{"platform": ["ubuntu-latest"], "python-version": ["3.10", "3.11", "3.12"]}'
32+
# build_installation: 'wheel' # Verify sdist and wheel installations/"builds" against Tests
33+
# # typecheck_policy: '1' # {0: Skip, 1: Run, 2: Run and allow failures}
34+
# # run_policy: '0' # Force skip of downstream 'test_build' Test Job
35+
# # artifact_name: 'BUILD_ARTIFACT'
3036

3137
codecov_coverage_host:
3238
needs: test_n_build
@@ -52,11 +58,19 @@ jobs:
5258
### DOCS BUILD/TEST - DOCUMENTATION SITE ###
5359
docs:
5460
name: Build Documentation
55-
uses: boromir674/automated-workflows/.github/workflows/policy_docs.yml@v1.15.0
61+
uses: boromir674/automated-workflows/.github/workflows/docs-job.yml@develop
5662
with:
57-
run_policy: '2'
63+
build_tool: 'sphinx'
64+
default_trigger: true
65+
override: '${{ vars.OV_DOCS }}'
5866
python_version: '3.11'
59-
command: 'REQS_FILE=reqs-docs.txt tox -e pin-deps -- -E docs && tox -e docs -vv -s false'
67+
upload_distro: true
68+
69+
# uses: boromir674/automated-workflows/.github/workflows/policy_docs.yml@v1.15.0
70+
# with:
71+
# run_policy: '2'
72+
# python_version: '3.11'
73+
# command: 'REQS_FILE=reqs-docs.txt tox -e pin-deps -- -E docs && tox -e docs -vv -s false'
6074

6175
### DRAW PYTHON DEPENDENCY GRAPHS ###
6276
code_visualization:
@@ -77,7 +91,7 @@ jobs:
7791
if: ${{ startsWith(github.event.ref, 'refs/tags/v') }}
7892
uses: ./.github/workflows/signal-deploy.yml
7993
with:
80-
main_branch: main
94+
main_branch: master
8195
release_branch: release
8296

8397
## JOB: PYPI UPLOAD ##

.github/workflows/codecov-upload.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,6 @@ jobs:
2121
- name: Checkout Repository
2222
uses: actions/checkout@v4
2323

24-
# Download the coverage artifact
25-
- name: Download Coverage Artifact
26-
uses: actions/download-artifact@v4
27-
with:
28-
name: ${{ inputs.coverage_artifact }}
29-
3024
# Get the Codecov binary
3125
- name: Get Codecov Binary
3226
run: |

.github/workflows/labeler.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: "Pull Request Labeler"
2+
3+
on: pull_request_target
4+
5+
jobs:
6+
label_PR:
7+
permissions:
8+
contents: read
9+
pull-requests: write
10+
runs-on: ubuntu-latest
11+
# This Job behaves as a Listener to PR events, and each step is a Handler
12+
steps:
13+
# HANDLER 1: Label PR, given file changes and Labeling Rules '.github/labeler.yml'
14+
- uses: actions/labeler@v5
15+
with:
16+
# if you want your labels to trigger other Workflows, pass-in a PAT
17+
# with permission for label creation events to trigger listeners
18+
repo-token: ${{ secrets.GITHUB_TOKEN }}

tox.ini

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,34 @@ commands =
167167
black {posargs:{env:APPLY_LINT:--check}} -S --config pyproject.toml "{env:LINT_ARGS:.}"
168168

169169

170+
[testenv:isort]
171+
# To see DIFF: tox -e isort -- --diff
172+
# To APPLY! : `APPLY_ISORT= tox -e isort`
173+
description = isort
174+
basepython = {env:TOXPYTHON:python3}
175+
deps = isort >= 5.0.0
176+
setenv = {[testenv]setenv}
177+
skip_install = true
178+
changedir = {toxinidir}
179+
commands = isort \
180+
{posargs:{env:APPLY_ISORT:--check}} \
181+
"{env:LINT_ARGS:.}"
182+
183+
184+
[testenv:black]
185+
# To see DIFF: `tox -e black -- --diff`
186+
# To APPLY! : `APPLY_BLACK= tox -e black`
187+
description = black ops
188+
basepython = {env:TOXPYTHON:python3}
189+
deps = black
190+
setenv = {[testenv]setenv}
191+
skip_install = true
192+
changedir = {toxinidir}
193+
commands = black {posargs:{env:APPLY_BLACK:--check}} \
194+
--skip-string-normalization \
195+
--config pyproject.toml "{env:LINT_ARGS:.}"
196+
197+
170198
[testenv:prospector]
171199
description = Analyse Python code and output information about errors, potential problems, convention violations and complexity.
172200
Runs the prospector tool which brings together the functionality of other Python analysis tools such as Pyflakes and McCabe complexity.

0 commit comments

Comments
 (0)