diff --git a/.github/workflows/pip-install.yml b/.github/workflows/pip-install.yml new file mode 100644 index 0000000000..99fe3c184a --- /dev/null +++ b/.github/workflows/pip-install.yml @@ -0,0 +1,60 @@ +name: Install with pip + +on: + pull_request: + paths: + - .github/workflows/pip-install.yml + - requirements.txt + - setup.py + push: + paths: + - .github/workflows/pip-install.yml + - requirements.txt + - setup.py + workflow_dispatch: + +env: + TESTING: 1 + +jobs: + pip-install: + strategy: + matrix: + os: + - ubuntu-latest + python-version: + - "3.12" + - "3.11" + - "3.10" + - "3.9" + - "3.8" + limited-dependencies: + - "" + - "TRUE" + include: + - os: macos-latest + python-version: "3.12" + - os: macos-latest + python-version: "3.12" + limited-dependencies: "TRUE" + - os: macos-latest + python-version: "3.8" + - os: macos-latest + python-version: "3.8" + limited-dependencies: "TRUE" + + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + cache: pip + - name: Install dependencies + env: + PARSONS_LIMITED_DEPENDENCIES: ${{ matrix.limited-dependencies }} + run: | + pip install -r requirements-dev.txt + pip install -e .[all] diff --git a/.github/workflows/test-linux-windows.yml b/.github/workflows/test-linux-windows.yml deleted file mode 100644 index ec191b7f8a..0000000000 --- a/.github/workflows/test-linux-windows.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: tests - -on: - pull_request: - branches: ["main", "major-release"] - push: - branches: ["main", "major-release"] - -env: - TESTING: 1 - -jobs: - build: - strategy: - matrix: - python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] - limited-dependencies: ['','TRUE'] - os: [ubuntu-latest] # add in windows-latest to add windows testing - - runs-on: ${{ matrix.os }} - - steps: - - - uses: actions/checkout@v4 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - cache: "pip" - - - name: Install dependencies - env: - PARSONS_LIMITED_DEPENDENCIES: ${{ matrix.limited-dependencies }} - run: | - python -m pip install -U pip - python -m pip install .[all] - python -m pip install -r requirements-dev.txt - - - name: Run tests - run: pytest -rf test/ - - - name: Check linting - run: | - ruff check parsons/ test/ useful_resources/ - ruff format --diff parsons/ test/ useful_resources/ diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000000..b8d06b9692 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,72 @@ +name: Pytest and ruff + +on: + pull_request: + paths: + - .github/workflows/test.yml + - requirements*.txt + - "**.py" + push: + paths: + - .github/workflows/test.yml + - requirements*.txt + - "**.py" + workflow_dispatch: + +env: + TESTING: 1 + +jobs: + test_and_lint: + strategy: + matrix: + os: + - ubuntu-latest + python-version: + - "3.12" + - "3.11" + - "3.10" + - "3.9" + - "3.8" + limited-dependencies: + - "" + - "TRUE" + include: + - os: macos-latest + python-version: "3.12" + - os: macos-latest + python-version: "3.12" + limited-dependencies: "TRUE" + - os: macos-latest + python-version: "3.8" + - os: macos-latest + python-version: "3.8" + limited-dependencies: "TRUE" + + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + cache: pip + - name: Install uv + run: | + pip install -U pip uv + - name: Install dependencies + env: + PARSONS_LIMITED_DEPENDENCIES: ${{ matrix.limited-dependencies }} + run: | + uv pip install --system -e .[all] + uv pip install --system -r requirements-dev.txt + - name: Lint + run: | + ruff check parsons/ test/ useful_resources/ + - name: Tests + run: pytest -rf test/ + - name: Format + run: | + ruff format --check --diff parsons/ test/ useful_resources/ + \ No newline at end of file diff --git a/.github/workflows/tests-mac.yml b/.github/workflows/tests-mac.yml deleted file mode 100644 index c895701836..0000000000 --- a/.github/workflows/tests-mac.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: tests for mac -# test mac on single python version as mac tests use 10x minutes/storage - -on: - pull_request: - branches: ["main", "major-release"] - push: - branches: ["main", "major-release"] - -env: - TESTING: 1 - -jobs: - build: - strategy: - matrix: - python-version: ['3.8', '3.11', '3.12'] - limited-dependencies: ['','TRUE'] - - runs-on: macos-latest - - steps: - - - uses: actions/checkout@v4 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - cache: "pip" - - - name: Install dependencies - env: - PARSONS_LIMITED_DEPENDENCIES: ${{ matrix.limited-dependencies }} - run: | - python -m pip install -U pip - python -m pip install .[all] - python -m pip install -r requirements-dev.txt - - - name: Run tests - run: pytest - - - name: Check linting - run: | - ruff check parsons/ test/ useful_resources/ - ruff format --diff test/ useful_resources/