Skip to content

Commit

Permalink
Split Python CI (iotaledger#1855)
Browse files Browse the repository at this point in the history
Co-authored-by: DaughterOfMars <[email protected]>
Co-authored-by: /alex/ <[email protected]>
  • Loading branch information
3 people authored Jan 23, 2024
1 parent a236939 commit ad19f4d
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 22 deletions.
66 changes: 45 additions & 21 deletions .github/workflows/bindings-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ concurrency:
cancel-in-progress: true

jobs:
lint:
format:
name: Python PEP8 format
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9"]
python-version: ["3.10"]

steps:
- name: Checkout the Source Code
Expand All @@ -58,7 +58,7 @@ jobs:
cache: pip
cache-dependency-path: bindings/python/requirements-dev.txt

- name: Install Dependencies for Python Binding Lint
- name: Install Dependencies for Python Binding Format
run: |
python3 -m pip install --upgrade setuptools pip wheel
python3 -m pip install tox-gh-actions
Expand All @@ -67,18 +67,57 @@ jobs:
working-directory: bindings/python
run: tox -e format

lint:
name: Python lint
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10"]

steps:
- name: Checkout the Source Code
uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }} and Pip Cache
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: bindings/python/requirements-dev.txt

- name: Install Dependencies for Python Binding Lint
run: |
python3 -m pip install --upgrade setuptools pip wheel
python3 -m pip install tox-gh-actions
- name: Install required packages (Ubuntu)
run: |
sudo apt-get install libudev-dev libusb-1.0-0-dev
- name: Run linter for iota_sdk
working-directory: bindings/python
run: tox -e lint-sdk

- name: Run linter for examples
working-directory: bindings/python
run: tox -e lint-examples

- name: Run linter for tests
working-directory: bindings/python
run: tox -e lint-tests

test:
name: Linter & Tests
needs: lint
name: Tests
needs: format
if: ${{ ! github.event.schedule }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# os: [windows-latest, macos-latest, ubuntu-latest]
os: [windows-latest, ubuntu-latest]
python-version: ["3.9"]
python-version: ["3.10", "3.11", "3.12"]

steps:
- name: Checkout the Source Code
Expand Down Expand Up @@ -112,21 +151,6 @@ jobs:
sudo apt-get update
sudo apt-get install libudev-dev libusb-1.0-0-dev
- name: Run linter for iota_sdk
if: ${{ startsWith(matrix.os, 'ubuntu-latest') }}
working-directory: bindings/python
run: tox -e lint-sdk

- name: Run linter for examples
if: ${{ startsWith(matrix.os, 'ubuntu-latest') }}
working-directory: bindings/python
run: tox -e lint-examples

- name: Run linter for tests
if: ${{ startsWith(matrix.os, 'ubuntu-latest') }}
working-directory: bindings/python
run: tox -e lint-tests

- name: Run tests
working-directory: bindings/python
run: tox
1 change: 0 additions & 1 deletion bindings/python/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ deps =
-r requirements-dev.txt
pylint
commands =
pip install .
pylint --rcfile=.pylintrc iota_sdk/**/*.py

[testenv:lint-examples]
Expand Down

0 comments on commit ad19f4d

Please sign in to comment.