Skip to content

Commit 4fb8558

Browse files
committed
feat Updating the overall project CI/CD and openapi-generator dependencies
Signed-off-by: S3B4SZ17 <[email protected]>
1 parent e9b0d33 commit 4fb8558

File tree

1,863 files changed

+45235
-45976
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,863 files changed

+45235
-45976
lines changed

.flake8

Lines changed: 0 additions & 6 deletions
This file was deleted.

.github/workflows/ci-master-scheduled.yml renamed to .github/workflows/ci-master-scheduled.yaml

Lines changed: 11 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -20,35 +20,25 @@ jobs:
2020
- "3.11"
2121
runs-on: ubuntu-latest
2222
steps:
23-
- uses: actions/checkout@v3
23+
- uses: actions/checkout@v4
2424

25-
- uses: actions/setup-python@v4
25+
- name: Setup python
26+
uses: actions/setup-python@v5
2627
with:
27-
python-version: ${{ matrix.python_version }}
28+
python-version: "${{ matrix.python_version }}"
2829

29-
- name: Install Poetry
30-
run: python -m pip install poetry poetry-dynamic-versioning
31-
32-
- uses: actions/cache@v3
33-
name: Cache Poetry dependencies
30+
- name: Install uv
31+
uses: astral-sh/setup-uv@v6
3432
with:
35-
path: |
36-
~/.cache
37-
~/.local/share/virtualenvs/
38-
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
39-
restore-keys: |
40-
${{ runner.os }}-poetry-
41-
42-
- name: Get dependencies
43-
run: poetry install
33+
python-version: "${{ matrix.python_version }}"
34+
enable-cache: true
35+
version: "0.8.7"
4436

4537
- name: Lint
4638
continue-on-error: true
4739
run: |
4840
# stop the build if there are Python syntax errors or undefined names
49-
poetry run flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
50-
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
51-
poetry run flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
41+
uvx ruff check . --fix --select=E9,F63,F7,F82 --statistics --config ruff.toml --exclude specs
5242
5343
- name: Travis Test - Start agent
5444
id: start_agent
@@ -59,11 +49,6 @@ jobs:
5949
sudo apt-get install linux-headers-$(uname -r) dkms gcc-multilib g++-multilib
6050
./test/start_agent.sh
6151
62-
- name: Travis Test - Install dependencies
63-
run: |
64-
poetry build
65-
python -m pip install $(find dist -iname "*.whl" | head -1)
66-
6752
- name: Travis Test - Secure APIs
6853
env:
6954
PYTHON_SDC_TEST_API_TOKEN: ${{ secrets.STAGING_SECURE_API_TOKEN }}
@@ -75,7 +60,7 @@ jobs:
7560
SDC_SECURE_TOKEN: ${{ secrets.STAGING_SECURE_API_TOKEN }}
7661
SDC_MONITOR_URL: "https://app-staging.sysdigcloud.com"
7762
SDC_SECURE_URL: "https://secure-staging.sysdig.com"
78-
run: poetry run mamba -f documentation
63+
run: uv run -- mamba -f documentation
7964

8065
- name: Travis Test - Stop agent
8166
run: ./test/stop_agent.sh

.github/workflows/ci-pull-request.yml renamed to .github/workflows/ci-pull-request.yaml

Lines changed: 23 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -15,54 +15,42 @@ jobs:
1515
matrix:
1616
python_version:
1717
# https://python-release-cycle.glitch.me/
18-
- "3.7"
19-
- "3.8"
2018
- "3.9"
2119
- "3.10"
2220
- "3.11"
2321
runs-on: ubuntu-latest
2422
steps:
25-
- uses: actions/checkout@v3
23+
- uses: actions/checkout@v4
2624

27-
- uses: actions/setup-python@v4
25+
- name: Setup python
26+
uses: actions/setup-python@v5
2827
with:
29-
python-version: ${{ matrix.python_version }}
28+
python-version: "${{ matrix.python_version }}"
3029

31-
- name: Install Poetry
32-
run: python -m pip install poetry poetry-dynamic-versioning
33-
34-
- uses: actions/cache@v3
35-
name: Cache Poetry dependencies
30+
- name: Install uv
31+
uses: astral-sh/setup-uv@v6
3632
with:
37-
path: |
38-
~/.cache
39-
~/.local/share/virtualenvs/
40-
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
41-
restore-keys: |
42-
${{ runner.os }}-poetry-
43-
44-
- name: Get dependencies
45-
run: poetry install
33+
python-version: "${{ matrix.python_version }}"
34+
enable-cache: true
35+
version: "0.8.7"
4636

4737
- name: Lint
4838
run: |
49-
# stop the build if there are Python syntax errors or undefined names
50-
poetry run flake8
5139
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
52-
poetry run flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
40+
uvx ruff check . --fix --select=E9,F63,F7,F82 --statistics --config ruff.toml --exclude specs
5341
5442
- name: Test in staging
5543
env:
5644
SDC_MONITOR_TOKEN: ${{ secrets.STAGING_MONITOR_API_TOKEN }}
5745
SDC_SECURE_TOKEN: ${{ secrets.STAGING_SECURE_API_TOKEN }}
5846
SDC_MONITOR_URL: "https://app-staging.sysdigcloud.com"
5947
SDC_SECURE_URL: "https://secure-staging.sysdig.com"
60-
run: poetry run mamba -f documentation -t integration
48+
run: uv run -- mamba -f documentation -t integration
6149

6250
test-release:
6351
runs-on: ubuntu-latest
64-
steps:
65-
- uses: actions/checkout@v3
52+
steps:
53+
- uses: actions/checkout@v4
6654
with:
6755
fetch-depth: 0
6856

@@ -79,15 +67,17 @@ jobs:
7967
- name: Generate changelog
8068
run: git-chglog -c .github/git-chglog/config.yml -o RELEASE_CHANGELOG.md $(git describe --tags $(git rev-list --tags --max-count=1))
8169

82-
- name: Set up Python
83-
uses: actions/setup-python@v4
70+
- name: Setup python
71+
uses: actions/setup-python@v5
8472
with:
85-
python-version: 3.8
73+
python-version: "3.10"
8674

87-
- name: Install dependencies
88-
run: |
89-
python -m pip install --upgrade pip
90-
pip install poetry poetry-dynamic-versioning
75+
- name: Install uv
76+
uses: astral-sh/setup-uv@v6
77+
with:
78+
python-version: "3.10"
79+
enable-cache: true
80+
version: "0.8.7"
9181

9282
- name: Build
93-
run: poetry build
83+
run: uv build

.github/workflows/codeql-analysis.yml renamed to .github/workflows/codeql-analysis.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030

3131
steps:
3232
- name: Checkout repository
33-
uses: actions/checkout@v3
33+
uses: actions/checkout@v4
3434
with:
3535
# We must fetch at least the immediate parents so that if this is
3636
# a pull request then we can checkout the head.
@@ -47,7 +47,7 @@ jobs:
4747
with:
4848
languages: ${{ matrix.language }}
4949
# If you wish to specify custom queries, you can do so here or in a config file.
50-
# By default, queries listed here will override any specified in a config file.
50+
# By default, queries listed here will override any specified in a config file.
5151
# Prefix the list here with "+" to use these queries and those in the config file.
5252
# queries: ./path/to/local/query, your-org/your-repo/queries@main
5353

.github/workflows/python.yaml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# NOTE: This file is auto generated by OpenAPI Generator.
2+
# URL: https://openapi-generator.tech
3+
#
4+
# ref: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
5+
6+
name: sysdig_client Python package
7+
8+
on: [push, pull_request]
9+
10+
jobs:
11+
build:
12+
13+
runs-on: ubuntu-latest
14+
strategy:
15+
matrix:
16+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
17+
max-parallel: 5
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
- name: Set up Python ${{ matrix.python-version }}
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: ${{ matrix.python-version }}
25+
- name: Install uv
26+
uses: astral-sh/setup-uv@v6
27+
with:
28+
python-version: "${{ matrix.python-version }}"
29+
enable-cache: true
30+
version: "0.8.7"
31+
- name: Download dependencies
32+
run: make init
33+
34+
- name: Run ruff
35+
run: make lint
36+
37+
- name: Run Unit Tests
38+
run: make test-all
39+
check_version:
40+
name: Check Version
41+
runs-on: ubuntu-latest
42+
needs: build
43+
permissions:
44+
contents: write # required for creating a tag
45+
steps:
46+
- name: Check out repository
47+
uses: actions/checkout@v4
48+
with:
49+
ref: ${{ github.sha }} # required for better experience using pre-releases
50+
fetch-depth: '0' # Required due to the way Git works, without it this action won't be able to find any or the correct tags
51+
52+
- name: Extract current version
53+
id: pyproject_version
54+
run: |
55+
TAG=v$(grep 'version =' pyproject.toml | sed -e 's/version = "\(.*\)"/\1/')
56+
echo "TAG=$TAG" >> "$GITHUB_OUTPUT"
57+
58+
- name: Get branch ref name
59+
id: branch_ref
60+
run: |
61+
BRANCH_NAME=${{ github.base_ref || github.ref_name }}
62+
echo "$BRANCH_NAME"
63+
echo "BRANCH_NAME=$BRANCH_NAME" >> "$GITHUB_OUTPUT"
64+
65+
- name: Get tag version
66+
id: semantic_release
67+
uses: anothrNick/[email protected]
68+
env:
69+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
70+
DEFAULT_BUMP: "patch"
71+
TAG_CONTEXT: 'repo'
72+
WITH_V: true
73+
DRY_RUN: true
74+
75+
- name: Compare versions
76+
run: |
77+
echo "Current version: ${{ steps.pyproject_version.outputs.TAG }}"
78+
echo "New version: ${{ steps.semantic_release.outputs.tag }}"
79+
if [ "${{ steps.pyproject_version.outputs.TAG }}" != "${{ steps.semantic_release.outputs.tag }}" ]; then
80+
echo "### Version mismatch detected! :warning:
81+
Current pyproject version: ${{ steps.pyproject_version.outputs.TAG }}
82+
New Tag version: **${{ steps.semantic_release.outputs.tag }}**
83+
Current Tag: ${{ steps.semantic_release.outputs.old_tag }}
84+
Please update the version in pyproject.toml." >> $GITHUB_STEP_SUMMARY
85+
exit 1
86+
else
87+
echo "### Version match confirmed! :rocket:
88+
Current pyproject version: ${{ steps.pyproject_version.outputs.TAG }}
89+
New Tag version: **${{ steps.semantic_release.outputs.tag }}**
90+
The version is up-to-date." >> $GITHUB_STEP_SUMMARY
91+
fi

.github/workflows/python.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.

.github/workflows/release.yml renamed to .github/workflows/release.yaml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
upload_url: ${{ steps.create_release.outputs.upload_url }}
1313

1414
steps:
15-
- uses: actions/checkout@v3
15+
- uses: actions/checkout@v4
1616
with:
1717
fetch-depth: 0
1818

@@ -52,10 +52,14 @@ jobs:
5252
with:
5353
python-version: 3.10
5454

55-
- name: Install dependencies
56-
run: |
57-
python -m pip install --upgrade pip
58-
pip install poetry poetry-dynamic-versioning
55+
- name: Install uv
56+
uses: astral-sh/setup-uv@v6
57+
with:
58+
python-version: 3.10
59+
enable-cache: true
60+
version: "0.8.7"
5961

6062
- name: Build and publish
61-
run: poetry publish --build -u ${{ secrets.PYPI_USER }} -p ${{ secrets.PYPI_PASSWORD }}
63+
run: |
64+
uv build
65+
uv publish -u ${{ secrets.PYPI_USER }} -p ${{ secrets.PYPI_PASSWORD }}

0 commit comments

Comments
 (0)