-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* expr: Rust based expressions * Integrate expr with filter and assign * Add eval and typeof to expr and move astype to TypeExpr * Add eval and typeof to expr and move astype to TypeExpr * Github actions using maturin
- Loading branch information
1 parent
801cdf0
commit 7572061
Showing
36 changed files
with
3,664 additions
and
535 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,86 +1,87 @@ | ||
name: Packagr Publish | ||
name: Build, Test, and Publish | ||
|
||
# Controls when the workflow will run | ||
on: | ||
# Triggers the workflow on push but only for the main branch | ||
push: | ||
branches: [ main ] | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
# This workflow contains a single job called "build" | ||
build: | ||
# The type of runner that the job will run on | ||
build-and-publish: | ||
runs-on: ubuntu-latest | ||
name: Build, Test, and Publish Package | ||
|
||
# Steps represent a sequence of tasks that will be executed as part of the job | ||
name: Run tests and publish latest version if succcessful | ||
steps: | ||
#---------------------------------------------- | ||
# check-out repo and set-up python | ||
#---------------------------------------------- | ||
- name: Check out repository | ||
# Checkout the Python client repository | ||
- name: Check out client repository (Python) | ||
uses: actions/checkout@v2 | ||
with: | ||
path: 'client' | ||
|
||
- name: Set up python | ||
id: setup-python | ||
# Checkout the Rust server repository | ||
- name: Check out server repository (Rust) | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: 'fennel-ai/server' | ||
token: ${{ secrets.SERVER_CHECKOUT }} | ||
path: 'server' | ||
ref: 'main' | ||
|
||
# Set up Python environment | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.12 | ||
|
||
#---------------------------------------------- | ||
# ----- install & configure poetry ----- | ||
#---------------------------------------------- | ||
# Install Poetry | ||
- name: Install Poetry | ||
uses: snok/install-poetry@v1 | ||
with: | ||
virtualenvs-create: true | ||
virtualenvs-in-project: true | ||
|
||
#---------------------------------------------- | ||
# load cached venv if cache exists | ||
#---------------------------------------------- | ||
# Load cached Python virtual environment if it exists | ||
- name: Load cached venv | ||
id: cached-poetry-dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: .venv | ||
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} | ||
|
||
#---------------------------------------------- | ||
# install dependencies if cache does not exist | ||
#---------------------------------------------- | ||
|
||
# Install Python dependencies if the cache does not exist | ||
- name: Install dependencies | ||
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | ||
run: poetry install --no-interaction --no-root | ||
|
||
#---------------------------------------------- | ||
# install your root project, if required | ||
#---------------------------------------------- | ||
- name: Install library | ||
run: poetry install --no-interaction | ||
# Set up Rust toolchain | ||
- name: Set up Rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
default: true | ||
|
||
# Install protobuf compiler (protoc) | ||
- name: Install protobuf compiler (protoc) | ||
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler | ||
|
||
# Install Maturin to build the package | ||
- name: Install Maturin | ||
run: python -m pip install maturin | ||
|
||
# Build the package using Maturin | ||
- name: Build the package using Maturin | ||
run: maturin build --release --manifest-path ./server/fennel_data_lib/Cargo.toml --out dist --no-sdist | ||
|
||
# Run test suite | ||
# Install the built package | ||
- name: Install built package | ||
run: pip install dist/*.whl | ||
|
||
# Run Python tests | ||
- name: Run tests | ||
run: | | ||
source .venv/bin/activate | ||
poetry run pytest . --run_slow | ||
poetry run python -m unittest discover fennel | ||
poetry run pytest fennel --run_slow | ||
#---------------------------------------------- | ||
# publish to pypi - this is run only if the previous steps are successful | ||
#---------------------------------------------- | ||
- name: Publish to Pypi | ||
# Publish the package to PyPI if all tests pass | ||
- name: Publish to PyPI | ||
run: | | ||
rm -rf dist/* | ||
pip install setuptools wheel twine | ||
poetry build | ||
twine upload --repository pypi dist/* --verbose -u __token__ -p ${{ secrets.PYPI_PACKAGR_ACCESS_TOKEN }} | ||
|
||
|
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.