| 1 |
name: Test Build |
| 2 |
|
| 3 |
on: |
| 4 |
schedule: |
| 5 |
- cron: 0 7 * * * |
| 6 |
push: |
| 7 |
branches: [ main ] |
| 8 |
pull_request: |
| 9 |
workflow_dispatch: |
| 10 |
|
| 11 |
# will cancel previous workflows triggered by the same event and for the same ref for PRs or same SHA otherwise |
| 12 |
concurrency: |
| 13 |
group: ${{ github.workflow }}-${{ github.event_name }}-${{ contains(github.event_name, 'pull_request') && github.event.pull_request.head.ref || github.sha }} |
| 14 |
cancel-in-progress: true |
| 15 |
|
| 16 |
|
| 17 |
jobs: |
| 18 |
test-build: |
| 19 |
name: build - ${{ matrix.os }} - ${{ matrix.py }} |
| 20 |
runs-on: ${{ matrix.os }} |
| 21 |
strategy: |
| 22 |
fail-fast: false |
| 23 |
matrix: |
| 24 |
os: |
| 25 |
- ubuntu-latest |
| 26 |
- MacOs-latest |
| 27 |
- Windows-latest |
| 28 |
py: |
| 29 |
- "3.14" |
| 30 |
- "3.13" |
| 31 |
- "3.12" |
| 32 |
- "3.11" |
| 33 |
- "3.10" |
| 34 |
steps: |
| 35 |
- name: Check out Repo |
| 36 |
uses: actions/checkout@v7 |
| 37 |
with: |
| 38 |
persist-credentials: false |
| 39 |
|
| 40 |
- name: Set up Python ${{ matrix.py }} |
| 41 |
id: setup-python |
| 42 |
uses: actions/setup-python@v7 |
| 43 |
with: |
| 44 |
python-version: ${{ matrix.py }} |
| 45 |
|
| 46 |
- name: Install uv |
| 47 |
uses: astral-sh/[email protected] |
| 48 |
with: |
| 49 |
version: "0.12.8" |
| 50 |
python-version: ${{ matrix.py }} |
| 51 |
|
| 52 |
- name: Ensure package can be built |
| 53 |
run: uv build --all-packages |
| 54 |
|
| 55 |
- name: Ensure package can be installed from whl |
| 56 |
if: matrix.os != 'Windows-latest' |
| 57 |
shell: bash |
| 58 |
run: | |
| 59 |
uv venv .testwhl |
| 60 |
source .testwhl/bin/activate |
| 61 |
uv pip install dist/$(ls dist/ | grep ".whl") |
| 62 |
deactivate |
| 63 |
|
| 64 |
- name: Ensure package can be installed from sdist |
| 65 |
if: matrix.os != 'Windows-latest' |
| 66 |
shell: bash |
| 67 |
run: | |
| 68 |
uv venv .testsdist |
| 69 |
source .testsdist/bin/activate |
| 70 |
uv pip install dist/$(ls dist/ | grep ".tar.gz") |
| 71 |
deactivate |
| 72 |
|
| 73 |
- name: Ensure package can be installed from whl (Windows) |
| 74 |
if: matrix.os == 'Windows-latest' |
| 75 |
shell: pwsh |
| 76 |
run: | |
| 77 |
uv venv .testwhl |
| 78 |
.testwhl\Scripts\activate |
| 79 |
uv pip install (Get-Item dist\*.whl).FullName |
| 80 |
deactivate |
| 81 |
|
| 82 |
- name: Ensure package can be installed from sdist (Windows) |
| 83 |
if: matrix.os == 'Windows-latest' |
| 84 |
shell: pwsh |
| 85 |
run: | |
| 86 |
uv venv .testsdist |
| 87 |
.testsdist\Scripts\activate |
| 88 |
uv pip install (Get-Item dist\*.tar.gz).FullName |
| 89 |
deactivate |