Skip to content

Commit

Permalink
feat(wasm): Support run code in wasm
Browse files Browse the repository at this point in the history
  • Loading branch information
fangyinc committed Nov 2, 2024
1 parent 3fbda7c commit 2a1791e
Show file tree
Hide file tree
Showing 113 changed files with 10,594 additions and 744 deletions.
50 changes: 29 additions & 21 deletions .github/workflows/release-python.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This file is autogenerated by maturin v1.7.1
# To update, run
#
# maturin generate-ci github -m bindings/lyric-py/Cargo.toml
# maturin generate-ci github -m bindings/python/lyric-py/Cargo.toml
#
name: Release Python

Expand Down Expand Up @@ -43,7 +43,7 @@ jobs:
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --out dist --find-interpreter --manifest-path bindings/lyric-py/Cargo.toml
args: --release --out dist --find-interpreter --manifest-path bindings/python/lyric-py/Cargo.toml
sccache: 'true'
# manylinux: auto
manylinux: ${{ matrix.platform.target == 'aarch64' && '2_24' || 'auto' }}
Expand All @@ -67,13 +67,6 @@ jobs:
unzip -o $PROTOC_ZIP -d /usr/local bin/protoc
unzip -o $PROTOC_ZIP -d /usr/local 'include/*'
rm -f $PROTOC_ZIP
# docker-options: |
# -e PROTOC=/usr/bin/protoc
# before-script-linux: |
# yum install -y protobuf-compiler
# echo "Which protoc: $(which protoc)"
# echo "Environment variables: $PROTOC"
# ls -l /usr/bin/protoc
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
Expand All @@ -100,7 +93,7 @@ jobs:
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --out dist --find-interpreter --manifest-path bindings/lyric-py/Cargo.toml
args: --release --out dist --find-interpreter --manifest-path bindings/python/lyric-py/Cargo.toml
sccache: 'true'
manylinux: musllinux_1_2
docker-options: |
Expand All @@ -118,13 +111,6 @@ jobs:
unzip -o $PROTOC_ZIP -d /usr/local bin/protoc
unzip -o $PROTOC_ZIP -d /usr/local 'include/*'
rm -f $PROTOC_ZIP
# docker-options: |
# -e PROTOC=/usr/bin/protoc
# before-script-linux: |
# apt-get update && apt-get install -y protobuf-compiler libprotobuf-dev
# echo "Which protoc: $(which protoc)"
# echo "Environment variables: $PROTOC"
# ls -l /usr/bin/protoc
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
Expand Down Expand Up @@ -153,7 +139,7 @@ jobs:
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --out dist --find-interpreter --manifest-path bindings/lyric-py/Cargo.toml
args: --release --out dist --find-interpreter --manifest-path bindings/python/lyric-py/Cargo.toml
sccache: 'true'
- name: Upload wheels
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -182,7 +168,7 @@ jobs:
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --out dist --find-interpreter --manifest-path bindings/lyric-py/Cargo.toml
args: --release --out dist --find-interpreter --manifest-path bindings/python/lyric-py/Cargo.toml
sccache: 'true'
- name: Upload wheels
uses: actions/upload-artifact@v4
Expand All @@ -198,7 +184,7 @@ jobs:
uses: PyO3/maturin-action@v1
with:
command: sdist
args: --out dist --manifest-path bindings/lyric-py/Cargo.toml
args: --out dist --manifest-path bindings/python/lyric-py/Cargo.toml
- name: Upload sdist
uses: actions/upload-artifact@v4
with:
Expand All @@ -208,7 +194,8 @@ jobs:
release:
name: Release
runs-on: ubuntu-latest
if: "startsWith(github.ref, 'refs/tags/')"
# Only trigger on GitHub Release creation
if: github.event_name == 'release' && github.event.action == 'published'
needs: [linux, musllinux, windows, macos, sdist]
steps:
- uses: actions/download-artifact@v4
Expand All @@ -219,3 +206,24 @@ jobs:
with:
command: upload
args: --non-interactive --skip-existing wheels-*/*
# Test the built wheels
test-wheels:
name: Test Wheels
runs-on: ubuntu-latest
if: github.event_name != 'release'
needs: [ linux, musllinux, windows, macos, sdist ]
steps:
- uses: actions/download-artifact@v4
with:
pattern: wheels-*
merge-multiple: true
path: dist
- uses: actions/setup-python@v5
with:
python-version: '3.10'
# Install the built wheel
- name: Install built wheel
run: |
python -m pip install --find-links=dist lyric-py
# Some integration tests
# python -m pytest
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
.ENV
.env
.ipynb_checkpoints/
.python-version
.yarn/
coverage.lcov
coverage.xml
profile.json
polars/vendor
tmp_expanded.rs

# OS
.DS_Store
Expand Down
Loading

0 comments on commit 2a1791e

Please sign in to comment.