|
| 1 | +name: build |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + types: [ opened, synchronize ] |
| 6 | + push: |
| 7 | + branches: [ main ] |
| 8 | + |
| 9 | +jobs: |
| 10 | + test-pipeline: |
| 11 | + runs-on: ${{ matrix.os }} |
| 12 | + strategy: |
| 13 | + max-parallel: 4 |
| 14 | + matrix: |
| 15 | + os: [ 'ubuntu-22.04' ] |
| 16 | + python-version: [ '3.10', '3.12' ] |
| 17 | + poetry-version: [ '1.3' ] |
| 18 | + |
| 19 | + steps: |
| 20 | + - uses: actions/checkout@v1 |
| 21 | + - name: Install poetry |
| 22 | + run: pipx install poetry |
| 23 | + - uses: actions/setup-python@v4 |
| 24 | + with: |
| 25 | + python-version: ${{ matrix.python-version }} |
| 26 | + cache: 'poetry' |
| 27 | + - name: Install dependencies |
| 28 | + run: poetry install |
| 29 | + - name: Run tests |
| 30 | + run: poetry run pytest --junitxml=test-unit.xml --cov=cyber_connectors --cov-report=term-missing:skip-covered --cov-report xml:cov.xml -vv tests/unit | tee pytest-coverage.txt |
| 31 | + - name: Publish Test Report |
| 32 | + uses: mikepenz/action-junit-report@v3 |
| 33 | + if: always() # always run even if the previous step fails |
| 34 | + with: |
| 35 | + report_paths: './test-unit.xml' |
| 36 | + # - name: Pytest coverage comment |
| 37 | + # uses: MishaKav/pytest-coverage-comment@main |
| 38 | + # if: always() # always run even if the previous step fails |
| 39 | + # with: |
| 40 | + # pytest-coverage-path: ./pytest-coverage.txt |
| 41 | + # pytest-xml-coverage-path: ./cov.xml |
| 42 | + # title: Unit tests code coverage |
| 43 | + # badge-title: Coverage |
| 44 | + # hide-badge: false |
| 45 | + # hide-report: false |
| 46 | + # create-new-comment: false |
| 47 | + # hide-comment: false |
| 48 | + # report-only-changed-files: false |
| 49 | + # remove-link-from-badge: false |
| 50 | + # junitxml-path: ./test-unit.xml |
| 51 | + # junitxml-title: Unit tests summary |
0 commit comments