Skip to content

Commit

Permalink
try refactoring CI
Browse files Browse the repository at this point in the history
  • Loading branch information
leoschwarz committed May 3, 2024
1 parent 0333231 commit c0c1f38
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 13 deletions.
16 changes: 16 additions & 0 deletions .github/actions/setup-bfabricpy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: "Setup bfabricPy"
inputs:
python-version:
description: "Python version to use"
required: true
runs:
using: "composite"
steps:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ inputs.python-version }}
- name: Install bfabricPy
run: |
pip install uv
uv pip install --system ".[dev]"
24 changes: 12 additions & 12 deletions .github/workflows/run_unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,29 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.9
uses: actions/setup-python@v2
- uses: ./.github/actions/setup-bfabricpy
with:
python-version: 3.9
- name: Install bfabricPy
run: |
pip install uv
uv pip install --system ".[dev]"
- name: Run unit tests
run: python -m unittest discover -s bfabric/tests/unit -p 'test_*.py'
code_style:
name: Code Style
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.9
uses: actions/setup-python@v2
- uses: ./.github/actions/setup-bfabricpy
with:
python-version: 3.9
- name: Install bfabricPy
run: |
pip install uv
uv pip install --system ".[dev]"
- name: Check code with ruff
run:
ruff bfabric || true
license_check:
name: License Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-bfabricpy
with:
python-version: 3.9
- name: Check licenses
run: licensecheck
6 changes: 5 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ dependencies = [
dev = [
"black",
"isort",
"ruff"
"ruff",
"licensecheck"
]

[project.urls]
Expand Down Expand Up @@ -74,3 +75,6 @@ target-version = "py39"

[tool.ruff.lint]
select = ["D103", "E", "F", "ANN", "PTH", "UP", "BLE", "SIM"]

[tool.licensecheck]
using = "PEP631"

0 comments on commit c0c1f38

Please sign in to comment.