|
9 | 9 | workflow_dispatch: |
10 | 10 | inputs: |
11 | 11 | version: |
12 | | - description: 'Version to publish' |
| 12 | + description: "Version to publish" |
13 | 13 | required: false |
14 | | - default: 'latest' |
| 14 | + default: "latest" |
15 | 15 | type: string |
16 | 16 |
|
17 | 17 | jobs: |
|
25 | 25 | - name: Check out the repo |
26 | 26 | uses: actions/checkout@v4 |
27 | 27 |
|
28 | | - - name: Setup python |
29 | | - uses: actions/setup-python@v5 |
30 | | - with: |
31 | | - python-version: '3.10' |
32 | | - cache: 'poetry' |
33 | | - |
34 | | - - name: Install dependencies |
35 | | - run: poetry install |
36 | | - |
37 | | - - name: Install uv |
38 | | - uses: astral-sh/setup-uv@v5 |
39 | | - with: |
40 | | - version: "0.7.17" |
41 | | - |
42 | | - - name: Download dependencies |
43 | | - run: | |
44 | | - uv sync |
45 | | -
|
46 | | - - name: Run ruff |
47 | | - run: | |
48 | | - uvx ruff check --fix --config ruff.toml |
49 | | -
|
50 | | - - name: Run Unit Tests |
51 | | - run: | |
52 | | - uv run pytest --capture=tee-sys --junitxml=pytest.xml |
53 | | -
|
54 | | - - name: Run Test Coverage |
55 | | - run: | |
56 | | - uv run pytest --cov=. --cov-report=xml |
57 | | -
|
58 | 28 | - name: Extract version |
59 | 29 | id: extract_version |
60 | 30 | run: | |
|
76 | 46 | tags: | |
77 | 47 | ghcr.io/sysdiglabs/sysdig-mcp-server:latest |
78 | 48 | ghcr.io/sysdiglabs/sysdig-mcp-server:v${{ steps.extract_version.outputs.VERSION }} |
79 | | -
|
80 | | - - name: "Check test reports exists" |
81 | | - if: always() |
82 | | - id: check-test-results-exists |
83 | | - uses: andstor/file-existence-action@v3 |
84 | | - with: |
85 | | - files: "pytest.xml, coverage.xml" |
86 | | - |
87 | | - - name: Create pack-wise pytest report |
88 | | - run: poetry run python .github/github_workflow_scripts/parse_junit_per_pack.py |
89 | | - if: | |
90 | | - always() && |
91 | | - steps.check-test-results-exists.outputs.files_exists == 'true' && |
92 | | - github.event.pull_request.head.repo.fork == false |
93 | | -
|
94 | | - - name: Upload junit & pack-wise pytest report |
95 | | - uses: PaloAltoNetworks/[email protected] |
96 | | - if: | |
97 | | - always() && |
98 | | - steps.check-test-results-exists.outputs.files_exists == 'true' && |
99 | | - github.event.pull_request.head.repo.fork == false |
100 | | - with: |
101 | | - name: pytest |
102 | | - path: | |
103 | | - coverage.xml |
104 | | - if-no-files-found: error |
105 | | - |
106 | | - - name: Pytest coverage comment |
107 | | - if: | |
108 | | - always() && |
109 | | - steps.check-test-results-exists.outputs.files_exists == 'true' && |
110 | | - steps.check-test-results-exists.outputs.files_exists == 'true' && |
111 | | - ! github.event.pull_request.head.repo.fork |
112 | | - |
113 | | - continue-on-error: true # may fail on output > 65k chars |
114 | | - with: |
115 | | - pytest-xml-coverage-path: coverage.xml |
116 | | - junitxml-path: coverage.xml |
0 commit comments