-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ad4d3df
commit c94c636
Showing
1 changed file
with
92 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
name: Code Integration | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
concurrency: | ||
group: ci-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
code-quality: | ||
name: Check linting, formatting and typing | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.10' | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install uv | ||
python -m uv pip install .[dev] | ||
- name: Lintting | ||
run: python -m ruff check . | ||
|
||
- name: Type checking | ||
run: python -m mypy . | ||
|
||
- name: Formatting | ||
run: python -m ruff format . | ||
|
||
- name: Check Diff | ||
run: | | ||
DIFF="$(git diff --name-only)" | ||
if [ -z "$DIFF" ]; then | ||
echo "OK: Format is clean" | ||
else | ||
echo "Error: Format was not clean" | ||
echo "List of files:" | ||
echo "$DIFF" | ||
git diff | ||
exit 1 | ||
fi | ||
testing: | ||
name: Test Python Package | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.10' | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install uv | ||
python -m uv pip install .[tests] | ||
- name: Testing | ||
run: pytest tests --cov=armonik_cli --cov-report=term-missing | ||
|
||
- name: Get Report | ||
uses: orgoro/coverage@3f13a558c5af7376496aa4848bf0224aead366ac | ||
with: | ||
coverageFile: packages/python/coverage.xml | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Archive code coverage results html | ||
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a | ||
with: | ||
name: code-coverage-report-html | ||
path: packages/python/coverage_report | ||
|
||
- name: Archive code coverage results xml | ||
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a | ||
with: | ||
name: code-coverage-report-xml | ||
path: packages/python/coverage.xml |