-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1280 from egbertbouman/actions
Added ruff/mypy/unittest workflows
- Loading branch information
Showing
3 changed files
with
86 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |