-
Notifications
You must be signed in to change notification settings - Fork 1
Add Sysdig SDK #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 6 commits
75d6cf7
7a04149
acdf52e
d1098a7
c55bf51
ff91bda
d91890e
dc9f8d7
c34f9c5
431e5a4
9bdb52f
1d56fc7
7432eb4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,4 +14,3 @@ README.md | |
| __pycache__/* | ||
| lib/ | ||
| .python-version | ||
| *.yaml | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # PR Name | ||
|
|
||
| ## Changes | ||
|
|
||
| Please provide a brief description of the major and minor changes made in this pull request. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,116 @@ | ||
| name: Publish Docker image | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| paths: | ||
| - pyproject.toml | ||
| workflow_dispatch: | ||
| inputs: | ||
| version: | ||
| description: 'Version to publish' | ||
| required: false | ||
| default: 'latest' | ||
| type: string | ||
|
|
||
| jobs: | ||
| push_to_registry: | ||
| name: Push Docker image to GitHub Packages | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read # required for actions/checkout | ||
| packages: write # required for pushing to ghcr.io | ||
| steps: | ||
| - name: Check out the repo | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: '3.10' | ||
| cache: 'poetry' | ||
|
|
||
| - name: Install dependencies | ||
| run: poetry install | ||
|
|
||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@v5 | ||
| with: | ||
| version: "0.7.17" | ||
|
|
||
| - name: Download dependencies | ||
| run: | | ||
| uv sync | ||
|
|
||
| - name: Run ruff | ||
| run: | | ||
| uvx ruff check --fix --config ruff.toml | ||
|
||
|
|
||
| - name: Run Unit Tests | ||
| run: | | ||
| uv run pytest --capture=tee-sys --junitxml=pytest.xml | ||
|
|
||
| - name: Run Test Coverage | ||
| run: | | ||
| uv run pytest --cov=. --cov-report=xml | ||
|
|
||
| - name: Extract version | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's split this into a different job that depends on the previous. This way we can execute the previous one locally with |
||
| id: extract_version | ||
| run: | | ||
| VERSION=$(grep 'version =' pyproject.toml | sed -e 's/version = "\(.*\)"/\1/')-$(echo $GITHUB_SHA | cut -c1-7) | ||
| echo "VERSION=$VERSION" >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Log in to GitHub Container Registry | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| registry: ghcr.io | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Build and push Docker image | ||
| uses: docker/build-push-action@v5 | ||
| with: | ||
| context: . | ||
| push: true | ||
| tags: | | ||
| ghcr.io/sysdiglabs/sysdig-mcp-server:latest | ||
| ghcr.io/sysdiglabs/sysdig-mcp-server:v${{ steps.extract_version.outputs.VERSION }} | ||
|
|
||
| - name: "Check test reports exists" | ||
| if: always() | ||
| id: check-test-results-exists | ||
| uses: andstor/file-existence-action@v3 | ||
| with: | ||
| files: "pytest.xml, coverage.xml" | ||
|
|
||
| - name: Create pack-wise pytest report | ||
| run: poetry run python .github/github_workflow_scripts/parse_junit_per_pack.py | ||
| if: | | ||
| always() && | ||
| steps.check-test-results-exists.outputs.files_exists == 'true' && | ||
| github.event.pull_request.head.repo.fork == false | ||
|
|
||
| - name: Upload junit & pack-wise pytest report | ||
| uses: PaloAltoNetworks/[email protected] | ||
| if: | | ||
| always() && | ||
| steps.check-test-results-exists.outputs.files_exists == 'true' && | ||
| github.event.pull_request.head.repo.fork == false | ||
| with: | ||
| name: pytest | ||
| path: | | ||
| coverage.xml | ||
| if-no-files-found: error | ||
|
|
||
| - name: Pytest coverage comment | ||
| if: | | ||
| always() && | ||
| steps.check-test-results-exists.outputs.files_exists == 'true' && | ||
| steps.check-test-results-exists.outputs.files_exists == 'true' && | ||
| ! github.event.pull_request.head.repo.fork | ||
| uses: MishaKav/[email protected] | ||
| continue-on-error: true # may fail on output > 65k chars | ||
| with: | ||
| pytest-xml-coverage-path: coverage.xml | ||
| junitxml-path: coverage.xml | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -44,6 +44,7 @@ htmlcov/ | |
| .cache | ||
| nosetests.xml | ||
| coverage.xml | ||
| pytest.xml | ||
| *,cover | ||
| .hypothesis/ | ||
| venv/ | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| repos: | ||
| - repo: local | ||
| hooks: | ||
| - id: ruff-format | ||
| name: Ruff Format | ||
| description: Format code with ruff. | ||
| entry: bash -c 'uvx ruff format --config ruff.toml' | ||
|
||
| language: system | ||
| stages: ["commit", "push"] | ||
| - id: ruff-check | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And here |
||
| name: Ruff Check | ||
| description: Check code style with ruff. | ||
| entry: bash -c 'uvx ruff check --config ruff.toml' | ||
| language: system | ||
| stages: ["commit", "push"] | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # These owners will be the default owners for everything in | ||
| # the repo. Unless a later match takes precedence, | ||
| # @S3B4SZ17 @alecron and @sysdiglabs/sysdig-training will be requested for | ||
| # review when someone opens a pull request. | ||
| * @S3B4SZ17 @alecron @sysdiglabs/sysdig-training | ||
|
||
Uh oh!
There was an error while loading. Please reload this page.