From 961f68f824b16407f73087d31a4500d7bb84c01e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ko=CC=88hler?= Date: Mon, 2 Dec 2024 22:02:56 +0100 Subject: [PATCH] Python CI: Fixup --- .github/workflows/python-ci.yml | 74 ++++++++++++++++++++------------- 1 file changed, 45 insertions(+), 29 deletions(-) diff --git a/.github/workflows/python-ci.yml b/.github/workflows/python-ci.yml index e71fb402..c36a06d2 100644 --- a/.github/workflows/python-ci.yml +++ b/.github/workflows/python-ci.yml @@ -13,42 +13,47 @@ permissions: contents: read jobs: - linting: - runs-on: ubuntu-latest - steps: - #---------------------------------------------- - # check-out repo and set-up python - #---------------------------------------------- - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - #---------------------------------------------- - # load pip cache if cache exists - #---------------------------------------------- - - uses: actions/cache@v4 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip - restore-keys: ${{ runner.os }}-pip - #---------------------------------------------- - # install and run linters - #---------------------------------------------- - - run: python -m pip install black flake8 isort - - run: | - flake8 . - black . --check - isort . +# linting: +# runs-on: ubuntu-latest +# steps: +# #---------------------------------------------- +# # check-out repo and set-up python +# #---------------------------------------------- +# - uses: actions/checkout@v4 +# - uses: actions/setup-python@v5 +# #---------------------------------------------- +# # load pip cache if cache exists +# #---------------------------------------------- +# - uses: actions/cache@v4 +# with: +# path: ~/.cache/pip +# key: ${{ runner.os }}-pip +# restore-keys: ${{ runner.os }}-pip +# #---------------------------------------------- +# # install and run linters +# #---------------------------------------------- +# - run: python -m pip install black flake8 isort +# - run: | +# flake8 . +# black . --check +# isort . test: # needs: linting strategy: - fail-fast: true + # fail-fast: true matrix: os: [ubuntu-latest, macos-latest] python-version: ['3.13'] runs-on: ${{ matrix.os }} + env: + ALLURE_RESULTS_PATH: 'build/${{ matrix.os }}_${{ matrix.python-version }}/allure-results' + ALLURE_REPORTS_PATH: 'build/${{ matrix.os }}_${{ matrix.python-version }}/allure-reports' + COVERAGE_REPORT_PATH: 'build/${{ matrix.os }}_${{ matrix.python-version }}/python-coverage-report' + steps: #---------------------------------------------- # check-out repo and set-up python @@ -99,15 +104,26 @@ jobs: # run test suite #---------------------------------------------- - name: "[Python] Run tests" - run: poetry run pytest --alluredir=build/allure-results --color no --cov=build/python-coverage-report --cov-report=html + run: > + poetry run pytest + --alluredir $ALLURE_RESULTS_PATH + --color no + --cov $COVERAGE_REPORT_PATH + --cov-report html - name: "[Python] Create coverage report" run: poetry run coverage report + - name: "[Python] Store coverage results" + uses: actions/upload-artifact@v4 + with: + name: python-coverage-report + path: $COVERAGE_REPORT_PATH + retention-days: 1 + - name: "[Python] Store allure test results" - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: allure-results - path: - allure-results + path: $ALLURE_RESULTS_PATH retention-days: 1