Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: Add wheel task, use in CI #1618

Closed
wants to merge 10 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 26 additions & 22 deletions .github/workflows/test-python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ jobs:
steps:
- name: 📂 Checkout code
uses: actions/checkout@v3
- uses: arduino/setup-task@v1
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Build wheel
uses: ./.github/actions/build-prql-python
with:
Expand All @@ -49,28 +52,29 @@ jobs:
with:
name: wheels
path: dist
- uses: actions/setup-python@v4
with:
python-version: "3.7"
- uses: actions/setup-python@v4
with:
python-version: "3.8"
- uses: actions/setup-python@v4
with:
python-version: "3.9"
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install nox
run: pipx install nox
shell: bash
- name: Cache Nox
uses: actions/cache@v3
with:
path: .nox
key:
nox-${{ hashFiles('prql-python/noxfile.py') }}-${{
hashFiles('prql-python/requirements.txt') }}
- name: Run tests
shell: bash
run: nox -s tests -f bindings/prql-python/noxfile.py
- run: pip install maturin
- name: Build wheel
run: task build-python-wheel
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The wheels have already been built.

jobs:
build-python-wheels:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest]
include:
- os: ubuntu-latest
target: x86_64
- os: ubuntu-latest
target: aarch64
- os: ubuntu-latest
target: source
steps:
- name: 📂 Checkout code
uses: actions/checkout@v3
- name: Build wheel
uses: ./.github/actions/build-prql-python
with:
target: ${{ matrix.target }}
test:
needs: [build-python-wheels]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]

# - uses: actions/setup-python@v4
# with:
# python-version: "3.9"
# - uses: actions/setup-python@v4
# with:
# python-version: "3.10"
- run: cd pip install . && pip install pytest && pytest .
# - name: Install nox
# run: pipx install nox
# shell: bash
# - name: Cache Nox
# uses: actions/cache@v3
# with:
# path: .nox
# key:
# nox-${{ hashFiles('prql-python/noxfile.py') }}-${{
# hashFiles('prql-python/requirements.txt') }}
# - name: Run tests
# shell: bash
# run: nox -s tests -f prql-python/noxfile.py
11 changes: 11 additions & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,17 @@ tasks:
- cargo build --all-targets --all-features --target=wasm32-unknown-unknown
- task: build-web

build-python-wheel:
dir: prql-python
cmds:
- cmd: maturin build --release ../dist
platforms: [windows, linux]
# I _think_ both of these are needed (at least the x86 seems to be needed on an ARM machine)
- cmd: rustup target add x86_64-apple-darwin aarch64-apple-darwin
platforms: [darwin]
- cmd: maturin build --release --universal2 -o ../dist
platforms: [darwin]

test-all:
desc: Test everything, accepting snapshots.
summary: |
Expand Down
Loading