Skip to content

Mode clean bin

Mode clean bin #130

name: Build package in standalone version
on:
workflow_dispatch:
pull_request:
jobs:
build-and-test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- '3.8'
- '3.9'
- '3.10'
- '3.11'
- '3.12'
steps:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- name: Install dependencies
run: python -m pip install poetry
- name: Install project
working-directory: ${{ github.workspace }}
run: poetry install --with dev
- name: Use CLI standalone
run: poetry run ${{ vars.MODULE_NAME }} -h
- name: Use CLI as Python module
run: poetry run python -m ${{ vars.MODULE_NAME }} -h
#- name: Check source code with Ruff
# run: poetry run python -m ruff check --config ./conf/ruff-src.toml
#
#- name: Check tests code with Ruff
# run: poetry run python -m ruff check --config ./conf/ruff-tests.toml
- name: Run unitary tests
env:
SCRIPT_PATH: ./scripts/run-tests.sh
run: |
chmod +x $SCRIPT_PATH
poetry run $SCRIPT_PATH unitary
- name: Run integration tests
env:
SCRIPT_PATH: ./scripts/run-tests.sh
run: |
chmod +x $SCRIPT_PATH
poetry run $SCRIPT_PATH integration
- name: Run e2e tests
env:
SCRIPT_PATH: ./scripts/run-tests.sh
run: |
chmod +x $SCRIPT_PATH
poetry run $SCRIPT_PATH e2e
- name: Generate report files
run: |
poetry run python -m coverage combine ./conf/coverage
poetry run python -m coverage xml
zip reports.zip coverage.xml reports.xml
- uses: actions/upload-artifact@v4
if: matrix.python-version == '3.12'
with:
name: test-reports
path: reports.zip
sonar-scan:
needs: build-and-test
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
fetch-depth: 0
- uses: actions/download-artifact@v4
with:
name: test-reports
path: ${{ github.workspace }}
- name: Unzip reports
run: unzip reports.zip
- name: SonarQube Scan
uses: SonarSource/sonarqube-scan-action@v4
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}