Remove exclude and add dynamic skipping for unsupported configurations #9
This file contains hidden or 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
| name: CI | ||
| on: | ||
| push: | ||
| branches: [ main ] | ||
| pull_request: | ||
| branches: [ main ] | ||
| jobs: | ||
| test: | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| matrix: | ||
| os: [ubuntu-latest, macos-latest, windows-latest] | ||
| python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] | ||
| fail-fast: false | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| - name: Set up Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| - name: Debug environment | ||
| run: | | ||
| echo "OS: ${{ matrix.os }}" | ||
| echo "Python Version: ${{ matrix.python-version }}" | ||
| python --version | ||
| pip --version | ||
| - name: Skip unsupported configurations | ||
| if: matrix.os == 'windows-latest' && matrix.python-version == '3.9' | ||
| run: echo "Skipping unsupported configuration: ${{ matrix.os }} with Python ${{ matrix.python-version }}" | ||
| - name: Install dependencies | ||
| if: matrix.os != 'windows-latest' || matrix.python-version != '3.9' | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install -e '.[test]' | ||
| - name: Install build tools (Windows) | ||
| if: runner.os == 'Windows' && matrix.python-version != '3.9' | ||
| run: | | ||
| choco install visualstudio2019buildtools --include-optional | ||
| - name: Run tests with pytest | ||
| if: matrix.os != 'windows-latest' || matrix.python-version != '3.9' | ||
| run: | | ||
| pytest tests/ -v | ||
| lint: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: '3.12' | ||
| - name: Debug environment | ||
| run: | | ||
| echo "Python Version:" | ||
| python --version | ||
| echo "Pip Version:" | ||
| pip --version | ||
| - name: Install linting dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install black isort flake8 | ||
| - name: Auto-fix formatting issues | ||
| run: | | ||
| black optimrl tests | ||
| isort optimrl tests | ||
| - name: Check code formatting | ||
| run: | | ||
| black --check optimrl tests | ||
| isort --check-only optimrl tests | ||
| flake8 optimrl tests | ||