Skip to content

Commit

Permalink
ci: build wheel in dedicated workflow step (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
iisakkirotko authored Nov 8, 2024
1 parent 789b187 commit 38e8d84
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 4 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Build

on:
workflow_call:

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"

- name: Install uv
uses: astral-sh/setup-uv@v3

- name: Install hatch
run: uv pip install hatch --system

- name: Build wheel
run: uv run hatch build -t wheel

- name: Upload wheel
uses: actions/upload-artifact@v4
with:
name: wheel-${{ github.run_number }}
path: dist/*.whl
29 changes: 25 additions & 4 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@ on:
- master
pull_request:

defaults:
run:
shell: bash {0}

jobs:
build:
uses: ./.github/workflows/build.yaml

pre-commit:
runs-on: ubuntu-latest
steps:
Expand All @@ -28,6 +35,7 @@ jobs:
pre-commit run --all-files
unit-tests:
needs: build
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand All @@ -47,15 +55,22 @@ jobs:
- name: Install uv
uses: astral-sh/setup-uv@v3

- name: Install dependencies
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: wheel-${{ github.run_number }}
path: dist

- name: Install package
run: |
uv pip install ".[test]" --system
uv pip install `echo dist/*.whl`[test] --system
- name: Run unit tests
run: |
pytest tests/unit
integration-tests:
needs: build
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand All @@ -75,9 +90,15 @@ jobs:
- name: Install uv
uses: astral-sh/setup-uv@v3

- name: Install dependencies
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: wheel-${{ github.run_number }}
path: dist

- name: Install package
run: |
uv pip install ".[test]" --system
uv pip install `echo dist/*.whl`[test] --system
- name: Install Playwright
run: |
Expand Down

0 comments on commit 38e8d84

Please sign in to comment.