diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..4d34ef0 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,48 @@ +name: Test and Lint Workflow + +on: + push: + branches: + - '*' + pull_request: + branches: + - main + +jobs: + test: + runs-on: ubuntu-latest + + steps: + # Checkout the code from the repository + - name: Checkout code + uses: actions/checkout@v3 + + # Set up Python environment + - name: Set up Python 3.10 + uses: actions/setup-python@v4 + with: + python-version: 3.10 + + # Install dependencies + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install .[dev] # Install both runtime and dev dependencies + + # Run linting with ruff (this will catch print statements) + - name: Lint with ruff + run: | + pip install ruff # Ensure ruff is available if not installed through dev dependencies + ruff check mumble tests # Lint your package and test directories + + # Run formatting checks with black + - name: Check formatting with black + run: | + pip install black # Ensure black is available if not installed through dev dependencies + black --check . # Check if code is correctly formatted + + # Run tests with pytest + - name: Run tests with pytest + run: | + pip install pytest + pytest --disable-warnings -q diff --git a/pyproject.toml b/pyproject.toml index 77ea851..19d3847 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,7 +28,7 @@ dependencies = [ "psm_utils >= 0.9.0", "numpy >= 1.23.0", ] -requires-python = ">=3.9" +requires-python = ">=3.10" [project.optional-dependencies] dev = ["ruff", "black", "pytest", "pre-commit", "bumpver"]