Skip to content

Commit

Permalink
Make CI always happen and Python build only on tag
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan-wanna-M committed Jun 19, 2024
1 parent f3441ed commit e02791e
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 46 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: CI

on:
push:
pull_request:

env:
CARGO_TERM_COLOR: always

jobs:
rust-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
python-test:
runs-on: ubuntu-latest
strategy:
matrix:
target: [x86_64]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: 3.9
architecture: x64
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
manylinux: auto
args: --out dist -m Cargo.toml
- name: Install built wheel
if: matrix.target == 'x86_64'
run: |
pip install kbnf --find-links dist --force-reinstall
python -c "import kbnf"
11 changes: 4 additions & 7 deletions .github/workflows/python_wheels.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
name: Python Build
name: Python Upload

on:
push:
branches: [ "master", "github-actions" ]
pull_request:
branches: [ "master", "github-actions" ]
tags:
- v*

jobs:
macos:
Expand Down Expand Up @@ -71,7 +70,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
target: [x86_64, i686]
target: [x86_64]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
Expand All @@ -85,7 +84,6 @@ jobs:
manylinux: auto
args: --release --out dist -m Cargo.toml
- name: Install built wheel
if: matrix.target == 'x86_64'
run: |
pip install kbnf --find-links dist --force-reinstall
python -c "import kbnf"
Expand Down Expand Up @@ -211,7 +209,6 @@ jobs:
release:
name: Release
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
needs: [ macos, windows, linux, linux-cross, musllinux, musllinux-cross ]
steps:
- uses: actions/download-artifact@v3
Expand Down
38 changes: 0 additions & 38 deletions .github/workflows/rust_lib.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![docs.rs](https://docs.rs/kbnf/badge.svg)](https://docs.rs/kbnf)
[![PyPI Version](https://img.shields.io/pypi/v/kbnf.svg)](https://pypi.python.org/pypi/kbnf)
![Python Build](https://github.com/Dan-wanna-M/kbnf/actions/workflows/python_wheels.yml/badge.svg)
![Rust Build](https://github.com/github/docs/actions/workflows/rust_lib.yml/badge.svg)
![CI](https://github.com/github/docs/actions/workflows/CI.yml/badge.svg)

This crate provides a constrained decoding engine which ensures that a language model's output adheres strictly to the format defined by KBNF (Koishi's BNF), an enhanced variant of EBNF. KBNF includes features that enhance usability, notably embeddable regular expressions and more flexible exceptions.

Expand Down

0 comments on commit e02791e

Please sign in to comment.