Skip to content

Commit 698eaf8

Browse files
committed
Merge branch 'stable' into develop
2 parents 204dc9e + dd3ff71 commit 698eaf8

File tree

13 files changed

+385
-72
lines changed

13 files changed

+385
-72
lines changed

.devcontainer/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ USER vscode
3636

3737
RUN pip install toml invoke
3838

39-
RUN curl -sSL https://install.python-poetry.org | POETRY_VERSION=1.8.5 python3 - \
39+
RUN curl -sSL https://install.python-poetry.org | POETRY_VERSION=2.1.3 python3 - \
4040
&& echo "export PATH=\"$HOME/.local/bin:$PATH\"" >> $HOME/.bashrc
4141

4242
RUN bash -c "$(curl -sL https://get.containerlab.dev)"

.github/workflows/ci-docker-image.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,12 @@ env:
4444
DOCKERFILE: "development/Dockerfile"
4545

4646
jobs:
47+
prepare-environment:
48+
uses: ./.github/workflows/define-versions.yml
4749
build:
50+
needs: prepare-environment
51+
env:
52+
POETRY_VERSION: ${{ needs.prepare-environment.outputs.POETRY_VERSION }}
4853
runs-on:
4954
group: huge-runners
5055
steps:

.github/workflows/ci.yml

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ env:
3030
METRICS_ENDPOINT: ${{ secrets.METRICS_ENDPOINT }}
3131

3232
jobs:
33-
# ------------------------------------------ Check Files Changes ------------------------------------------
33+
prepare-environment:
34+
uses: ./.github/workflows/define-versions.yml
35+
# ------------------------------------------ Check Files Changes ------------------------------------------
3436
files-changed:
3537
name: Detect which file has changed
3638
runs-on: ubuntu-latest
@@ -61,7 +63,7 @@ jobs:
6163
token: ${{ github.token }}
6264
filters: .github/file-filters.yml
6365

64-
# ------------------------------------------ All Linter ------------------------------------------
66+
# ------------------------------------------ All Linter ------------------------------------------
6567
yaml-lint:
6668
if: needs.files-changed.outputs.yaml == 'true'
6769
needs: ["files-changed"]
@@ -161,7 +163,7 @@ jobs:
161163

162164
infrahub-testcontainers-check:
163165
if: needs.files-changed.outputs.infrahub_poetry_files == 'true'
164-
needs: ["files-changed"]
166+
needs: ["prepare-environment", "files-changed"]
165167
runs-on: ubuntu-latest
166168
timeout-minutes: 5
167169
steps:
@@ -177,7 +179,7 @@ jobs:
177179

178180
- name: "Setup Python environment"
179181
run: |
180-
pipx install poetry==1.8.5
182+
pipx install poetry==${{ needs.prepare-environment.outputs.POETRY_VERSION }}
181183
poetry config virtualenvs.create true --local
182184
poetry env use 3.12
183185
@@ -404,13 +406,14 @@ jobs:
404406
!contains(needs.*.result, 'cancelled') &&
405407
(needs.files-changed.outputs.backend == 'true' ||
406408
needs.files-changed.outputs.testcontainers == 'true')
407-
needs: ["files-changed", "yaml-lint", "python-lint"]
409+
needs: ["prepare-environment", "files-changed", "yaml-lint", "python-lint"]
408410
runs-on:
409411
group: huge-runners
410412
timeout-minutes: 45
411413
env:
412414
INFRAHUB_DB_TYPE: neo4j
413415
PYTEST_XDIST_WORKER_COUNT: 1
416+
POETRY_VERSION: ${{ needs.prepare-environment.outputs.POETRY_VERSION }}
414417
steps:
415418
- name: "Check out repository code"
416419
uses: "actions/checkout@v4"
@@ -509,7 +512,7 @@ jobs:
509512
!contains(needs.*.result, 'cancelled') &&
510513
(needs.files-changed.outputs.backend == 'true' ||
511514
needs.files-changed.outputs.documentation == 'true')
512-
needs: ["files-changed", "yaml-lint", "python-lint", "infrahub-testcontainers-check"]
515+
needs: ["prepare-environment", "files-changed", "yaml-lint", "python-lint", "infrahub-testcontainers-check"]
513516
runs-on: ubuntu-latest
514517
steps:
515518
- name: Check out repository code
@@ -522,7 +525,7 @@ jobs:
522525
python-version: 3.12
523526
- name: "Setup environment"
524527
run: |
525-
pipx install poetry==1.8.5
528+
pipx install poetry==${{ needs.prepare-environment.outputs.POETRY_VERSION }}
526529
poetry config virtualenvs.create true --local
527530
poetry env use 3.12
528531
pip install invoke toml
@@ -625,7 +628,7 @@ jobs:
625628
!contains(needs.*.result, 'failure') &&
626629
!contains(needs.*.result, 'cancelled') &&
627630
(needs.files-changed.outputs.python == 'true') || (needs.files-changed.outputs.documentation == 'true')
628-
needs: ["files-changed", "yaml-lint", "python-lint", "infrahub-testcontainers-check"]
631+
needs: ["prepare-environment", "files-changed", "yaml-lint", "python-lint", "infrahub-testcontainers-check"]
629632
runs-on: "ubuntu-22.04"
630633
timeout-minutes: 5
631634
steps:
@@ -639,7 +642,7 @@ jobs:
639642
python-version: "3.12"
640643
- name: "Setup Python environment"
641644
run: |
642-
pipx install poetry==1.8.5
645+
pipx install poetry==${{ needs.prepare-environment.outputs.POETRY_VERSION }}
643646
poetry config virtualenvs.create true --local
644647
poetry env use 3.12
645648
- name: "Install dependencies"
@@ -705,6 +708,7 @@ jobs:
705708
run:
706709
working-directory: ./frontend/app
707710
needs:
711+
- prepare-environment
708712
- javascript-lint
709713
- files-changed
710714
- yaml-lint
@@ -724,6 +728,7 @@ jobs:
724728
- name: E2E-testing-playwright
725729
env:
726730
INFRAHUB_DB_TYPE: neo4j
731+
POETRY_VERSION: ${{ needs.prepare-environment.outputs.POETRY_VERSION }}
727732
# - name: E2E-testing-playwright-nats
728733
# env:
729734
# INFRAHUB_DB_TYPE: neo4j
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
# yamllint disable rule:truthy rule:truthy rule:line-length
3+
name: "Define versions"
4+
on:
5+
workflow_call:
6+
outputs:
7+
POETRY_VERSION:
8+
value: "2.1.3"
9+
10+
jobs:
11+
prepare:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- run: "true"

.github/workflows/poetry-check.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ on:
99
description: "Directory in which poetry check will be executed"
1010
default: "./"
1111
jobs:
12+
prepare-environment:
13+
uses: ./.github/workflows/define-versions.yml
1214
poetry_check:
15+
needs: prepare-environment
1316
runs-on: "ubuntu-latest"
1417
steps:
1518
- name: "Check out repository code"
@@ -22,7 +25,7 @@ jobs:
2225
python-version: "3.12"
2326
- name: "Setup environment"
2427
run: |
25-
pipx install poetry==1.8.5
28+
pipx install poetry==${{ needs.prepare-environment.outputs.POETRY_VERSION }}
2629
- name: "Validate pyproject.toml and consistency with poetry.lock"
2730
run: |
2831
poetry check

.github/workflows/publish-pypi.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,15 @@ on:
2828
default: false
2929

3030
jobs:
31+
prepare-environment:
32+
uses: ./.github/workflows/define-versions.yml
3133
publish_to_pypi:
3234
name: "Publish Infrahub-Server and Infrahub-Testcontainers to PyPI"
3335
runs-on: "ubuntu-22.04"
3436
strategy:
3537
matrix:
3638
package_dir: ["", "python_testcontainers"]
39+
needs: prepare-environment
3740
steps:
3841
- name: "Set up Python"
3942
uses: "actions/setup-python@v5"
@@ -42,7 +45,7 @@ jobs:
4245
- name: "Install Poetry"
4346
uses: "snok/install-poetry@v1"
4447
with:
45-
version: 1.8.5
48+
version: ${{ needs.prepare-environment.outputs.POETRY_VERSION }}
4649
virtualenvs-create: true
4750
virtualenvs-in-project: true
4851
installer-parallel: true

.github/workflows/release.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@ on:
88
- published
99

1010
jobs:
11+
prepare-environment:
12+
uses: ./.github/workflows/define-versions.yml
1113
check_release:
1214
runs-on: ubuntu-22.04
15+
needs: prepare-environment
1316
outputs:
1417
is_prerelease: ${{ steps.release.outputs.is_prerelease }}
1518
is_devrelease: ${{ steps.release.outputs.is_devrelease }}
@@ -30,7 +33,7 @@ jobs:
3033
- name: "Install Poetry"
3134
uses: "snok/install-poetry@v1"
3235
with:
33-
version: 1.8.5
36+
version: ${{ needs.prepare-environment.outputs.POETRY_VERSION }}
3437
virtualenvs-create: true
3538
virtualenvs-in-project: true
3639
installer-parallel: true

.github/workflows/update-compose-file-and-chart.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,11 @@ on:
1818
- closed
1919

2020
jobs:
21+
prepare-environment:
22+
uses: ./.github/workflows/define-versions.yml
2123
update-docker-compose:
2224
runs-on: ubuntu-latest
25+
needs: prepare-environment
2326
if: |
2427
github.event_name == 'push' ||
2528
(github.event_name == 'pull_request' && github.event.pull_request.merged == true &&
@@ -38,7 +41,7 @@ jobs:
3841
python-version: 3.12
3942
- name: "Setup environment"
4043
run: |
41-
pipx install poetry==1.8.5
44+
pipx install poetry==${{ needs.prepare-environment.outputs.POETRY_VERSION }}
4245
poetry config virtualenvs.prefer-active-python true
4346
- name: "Install Package"
4447
run: "poetry install --all-extras"

.github/workflows/version-upgrade.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ env:
2626
VMAGENT_PORT: 0
2727

2828
jobs:
29+
prepare-environment:
30+
uses: ./.github/workflows/define-versions.yml
2931
migration-tests:
3032
strategy:
3133
fail-fast: false
@@ -39,8 +41,10 @@ jobs:
3941
runs-on:
4042
group: huge-runners
4143
timeout-minutes: 120
44+
needs: prepare-environment
4245
env:
4346
INFRAHUB_DB_TYPE: neo4j
47+
POETRY_VERSION: ${{ needs.prepare-environment.outputs.POETRY_VERSION }}
4448
steps:
4549
- name: "Check out repository code"
4650
uses: "actions/checkout@v4"
@@ -52,7 +56,7 @@ jobs:
5256
python-version: 3.12
5357
- name: "Setup python environment"
5458
run: |
55-
pipx install poetry==1.8.5
59+
pipx install poetry==${{ env.POETRY_VERSION }}
5660
poetry config virtualenvs.prefer-active-python true
5761
pip install invoke toml
5862
- name: "Install Package"

development/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# STAGE : Base Python Image
33
# ****************************************************************
44
ARG PYTHON_VER=3.12
5+
ARG POETRY_VER
56
FROM docker.io/python:${PYTHON_VER}-slim AS base
67

78
ENV PYTHONUNBUFFERED 1
@@ -24,7 +25,7 @@ RUN apt-get update && \
2425
tee /etc/apt/sources.list.d/docker.list > /dev/null && \
2526
apt-get update && \
2627
apt-get install --no-install-recommends -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin && \
27-
curl -sSL https://install.python-poetry.org | POETRY_VERSION=1.8.5 python3 - && \
28+
curl -sSL https://install.python-poetry.org | POETRY_VERSION=$POETRY_VER python3 - && \
2829
apt-get autoremove -y && \
2930
apt-get clean all && \
3031
rm -rf /var/lib/apt/lists/* && \

0 commit comments

Comments
 (0)