Skip to content

Commit

Permalink
ci: add code integration workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
qdelamea-aneo committed Oct 15, 2024
1 parent ad4d3df commit c94c636
Showing 1 changed file with 92 additions and 0 deletions.
92 changes: 92 additions & 0 deletions .github/workflows/ci.yml
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

0 comments on commit c94c636

Please sign in to comment.