Switch project license to Apache 2.0 #10
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: | |
| - master | |
| - main | |
| pull_request: | |
| jobs: | |
| test: | |
| name: Test Python ${{ matrix.python-version }} | |
| runs-on: ubuntu-latest | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v5 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install package and test tools | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install -e .[dev] | |
| - name: Run unit tests | |
| if: matrix.python-version != '3.14' | |
| run: python -m pytest tests/unit tests/integration | |
| - name: Run coverage tests | |
| if: matrix.python-version == '3.14' | |
| run: python -m pytest --cov=api --cov=core --cov=models --cov=units --cov=utils --cov-report=xml tests/unit tests/integration | |
| - name: Upload coverage to Codecov | |
| if: matrix.python-version == '3.14' && env.CODECOV_TOKEN != '' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false) | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| files: ./coverage.xml | |
| token: ${{ env.CODECOV_TOKEN }} | |
| fail_ci_if_error: true | |
| build: | |
| name: Build distributions | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v5 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.13" | |
| - name: Install build tools | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install build twine | |
| - name: Build source and wheel distributions | |
| run: python -m build --outdir artifacts/dist | |
| - name: Check built distributions | |
| run: python -m twine check artifacts/dist/* | |
| - name: Upload distribution artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: python-units-dist | |
| path: artifacts/dist/* |