Skip to content

Commit

Permalink
fix testing workflow (#38)
Browse files Browse the repository at this point in the history
Fix testing workflow:
- syntax correction
- Codecov reporting now functional
  • Loading branch information
trappitsch committed Jan 20, 2024
1 parent f6ead34 commit f6c4f08
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
16 changes: 13 additions & 3 deletions .github/workflows/package_testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ on:
pull_request:
branches: [ main ]

env:
MAIN_PYTHON_VERSION: "3.12"

jobs:
# Build and test
build:
Expand All @@ -25,11 +28,18 @@ jobs:
run: |
rye pin ${{ matrix.python-version }}
rye sync
- name: Run Tests
- name: Run Tests for CLI
run: rye run test
- name: Run Lint on one python
if: ${{ matrix.python-version == env.MAIN_PYTHON_VERSION }}
run: rye run lint
if: matrix.python-version == "3.12"
- name: Run Pytest with coverage
if: ${{ matrix.python-version == env.MAIN_PYTHON_VERSION }}
run: |
cd controller_cli
rye run test_cov
- name: Upload coverage reports to Codecov
if: ${{ matrix.python-version == env.MAIN_PYTHON_VERSION && github.repository_owner == 'galactic-forensics' }}
uses: codecov/codecov-action@v3
if: github.repository_owner == 'galactic-forensics'
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
3 changes: 3 additions & 0 deletions controller_cli/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ dev-dependencies = [
"mock_serial>=0.0.1",
]

[tool.rye.scripts]
test_cov = "pytest --cov --cov-report xml"

[tool.hatch.metadata]
allow-direct-references = true

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ dev-dependencies = [
[tool.rye.scripts]
format = "ruff format ."
lint = "ruff check ."
test = "pytest --cov controller_cli"
test = "pytest controller_cli"

[tool.rye.workspace]
members = ["controller_cli", "controller"]
Expand Down

0 comments on commit f6c4f08

Please sign in to comment.