Skip to content

Commit

Permalink
Merge pull request #1280 from egbertbouman/actions
Browse files Browse the repository at this point in the history
Added ruff/mypy/unittest workflows
  • Loading branch information
egbertbouman committed Mar 5, 2024
2 parents e768329 + 8fca14e commit 0e1660e
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/mypy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Mypy
on: [pull_request, workflow_dispatch]
jobs:
mypy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Python 3.8
uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Install mypy
run: pip install mypy
- name: Run mypy
run: mypy -p ipv8
23 changes: 23 additions & 0 deletions .github/workflows/ruff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Ruff
on: [pull_request, workflow_dispatch]
jobs:
ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Python 3.8
uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Install ruff
run: pip install ruff
- name: Get changed Python files
id: changed-py-files
uses: tj-actions/changed-files@v42
with:
files: |
*.py
**/*.py
- name: Run ruff
if: steps.changed-py-files.outputs.any_changed == 'true'
run: ruff check ${{ steps.changed-py-files.outputs.all_changed_files }}
48 changes: 48 additions & 0 deletions .github/workflows/unittests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Unittests
on: [pull_request, workflow_dispatch]
jobs:
linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.7'
cache: 'pip'
- run: python -m pip install -r requirements.txt
- name: Run unit tests
run: python run_all_tests.py -a
windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.8'
cache: 'pip'
- uses: actions/cache/restore@v3
id: restore_cache
with:
path: libsodium.dll
key: cache_libsodium_dll
- run: python -m pip install -r requirements.txt
- name: Run unit tests
run: python run_all_tests.py -a
- uses: actions/cache/save@v3
id: save_cache
with:
path: libsodium.dll
key: cache_libsodium_dll
macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.8'
cache: 'pip'
- run: python -m pip install -r requirements.txt
- name: Run unit tests
run: |
pip install pytest pytest-xdist
pytest -n auto ipv8

0 comments on commit 0e1660e

Please sign in to comment.