Skip to content

Commit

Permalink
Python CI: Fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
martinjankoehler committed Dec 2, 2024
1 parent 2fbb542 commit 961f68f
Showing 1 changed file with 45 additions and 29 deletions.
74 changes: 45 additions & 29 deletions .github/workflows/python-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

0 comments on commit 961f68f

Please sign in to comment.