Skip to content

Commit

Permalink
simplify pipeline and allow change of python version dynamically
Browse files Browse the repository at this point in the history
  • Loading branch information
JAlvarezJarreta committed May 28, 2024
1 parent e8b8394 commit 9153d41
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 16 deletions.
4 changes: 2 additions & 2 deletions .github/actions/python_build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ description: "Common steps to build the Python environment"
runs:
using: "composite"
steps:
- name: Set up Python ${{ matrix.python-version }}
- name: Set up Python ${{ PYTHON_VERSION }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
python-version: ${{ PYTHON_VERSION }}

- name: Install dependencies
run: |
Expand Down
19 changes: 5 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ defaults:
run:
working-directory: ./

env:
PYTHON_VERSION: "3.9"

jobs:
pylint:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9"]

steps:
- uses: actions/checkout@v4
Expand All @@ -60,9 +60,6 @@ jobs:
mypy:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9"]

steps:
- uses: actions/checkout@v4
Expand All @@ -75,9 +72,6 @@ jobs:
black:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9"]

steps:
- uses: actions/checkout@v4
Expand All @@ -89,17 +83,14 @@ jobs:
pytest:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9"]

steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/python_build

- name: Run pytest with coverage
run: |
coverage run -m pytest --junitxml=./reports/test-results-${{ matrix.python-version }}.xml
coverage run -m pytest --junitxml=./reports/test-results-${{ PYTHON_VERSION }}.xml
coverage xml -o ./reports/coverage.xml
coverage report -m
Expand All @@ -108,7 +99,7 @@ jobs:
uses: MishaKav/pytest-coverage-comment@main
with:
pytest-xml-coverage-path: ./reports/coverage.xml
junitxml-path: ./reports/test-results-${{ matrix.python-version }}.xml
junitxml-path: ./reports/test-results-${{ PYTHON_VERSION }}.xml

- name: Create coverage badge
uses: schneegans/[email protected]
Expand Down

0 comments on commit 9153d41

Please sign in to comment.