|
| 1 | +# This workflow will install Python dependencies, run tests, and smoke |
| 2 | +# the sdist/wheel on a range of Python versions. |
| 3 | +# |
| 4 | +# Created: 21st August 2026 |
| 5 | +# Updated: 14th September 2026 |
| 6 | +# |
| 7 | + |
| 8 | +name: Python package |
| 9 | + |
| 10 | +on: |
| 11 | + push: |
| 12 | + branches: |
| 13 | + - master |
| 14 | + - dev |
| 15 | + - boilerplate |
| 16 | + - idiomatic |
| 17 | + - rc1 |
| 18 | + - rc2 |
| 19 | + - rc3 |
| 20 | + pull_request: |
| 21 | + |
| 22 | +permissions: |
| 23 | + contents: read |
| 24 | + |
| 25 | +defaults: |
| 26 | + run: |
| 27 | + shell: bash |
| 28 | + |
| 29 | +jobs: |
| 30 | + lint: |
| 31 | + name: Lint (ruff) |
| 32 | + runs-on: ubuntu-latest |
| 33 | + |
| 34 | + steps: |
| 35 | + - name: Checking out code |
| 36 | + uses: actions/checkout@v4 |
| 37 | + |
| 38 | + - name: Set up Python |
| 39 | + uses: actions/setup-python@v5 |
| 40 | + with: |
| 41 | + python-version: "3.14" |
| 42 | + |
| 43 | + - name: Install dependencies |
| 44 | + run: | |
| 45 | + python -m pip install --upgrade pip |
| 46 | + python -m pip install ruff |
| 47 | +
|
| 48 | + - name: Lint with ruff |
| 49 | + run: | |
| 50 | + ruff check . |
| 51 | +
|
| 52 | + build: |
| 53 | + |
| 54 | + runs-on: ubuntu-latest |
| 55 | + strategy: |
| 56 | + fail-fast: false |
| 57 | + matrix: |
| 58 | + python-version: |
| 59 | + - "3.8" |
| 60 | + - "3.9" |
| 61 | + - "3.10" |
| 62 | + - "3.11" |
| 63 | + - "3.12" |
| 64 | + - "3.13" |
| 65 | + - "3.14" |
| 66 | + |
| 67 | + steps: |
| 68 | + - name: Checking out code |
| 69 | + uses: actions/checkout@v4 |
| 70 | + |
| 71 | + - name: Set up Python ${{ matrix.python-version }} |
| 72 | + uses: actions/setup-python@v5 |
| 73 | + with: |
| 74 | + python-version: ${{ matrix.python-version }} |
| 75 | + |
| 76 | + - name: Install dependencies |
| 77 | + run: | |
| 78 | + python -m pip install --upgrade pip |
| 79 | + python -m pip install pytest |
| 80 | + python -m pip install -e . |
| 81 | +
|
| 82 | + - name: Test with pytest |
| 83 | + run: | |
| 84 | + pytest |
| 85 | +
|
| 86 | + - name: Build and install smoke |
| 87 | + run: | |
| 88 | + python -m pip install build |
| 89 | + python -m build |
| 90 | + python -m pip install dist/libclimate-*.whl |
| 91 | + python -c "import libclimate; assert libclimate.__version__ == '0.0.0.1'; print(libclimate.__version__)" |
| 92 | +
|
| 93 | + build-py27: |
| 94 | + |
| 95 | + runs-on: ubuntu-latest |
| 96 | + container: |
| 97 | + image: python:2.7-slim |
| 98 | + steps: |
| 99 | + - uses: actions/checkout@v4 |
| 100 | + - name: Install dependencies |
| 101 | + run: | |
| 102 | + python -m pip install --upgrade "pip<21" setuptools |
| 103 | + python -m pip install diagnosticism pyclasp woad |
| 104 | + - name: Compile library modules |
| 105 | + run: | |
| 106 | + python -m compileall libclimate |
| 107 | + - name: Test with unittest |
| 108 | + run: | |
| 109 | + python -m unittest discover -s tests |
| 110 | + env: |
| 111 | + PYTHONPATH: ${{ github.workspace }} |
0 commit comments