diff options
author | Lukas Kreussel <65088241+LLukas22@users.noreply.github.com> | 2023-10-20 20:05:14 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-20 19:05:14 +0100 |
commit | cfb423ab761fcb2ae3b9e36a18b0f6e5dd7cd253 (patch) | |
tree | 6819191f120ca28ce22c417778ff2a3747af13df /.github | |
parent | 7366aeac21d2be65bddf8691223f654c0ed8fd0b (diff) | |
download | candle-cfb423ab761fcb2ae3b9e36a18b0f6e5dd7cd253.tar.gz candle-cfb423ab761fcb2ae3b9e36a18b0f6e5dd7cd253.tar.bz2 candle-cfb423ab761fcb2ae3b9e36a18b0f6e5dd7cd253.zip |
PyO3: Add CI (#1135)
* Add PyO3 ci
* Update python.yml
* Format `bert.py`
Diffstat (limited to '.github')
-rw-r--r-- | .github/workflows/python.yml | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml new file mode 100644 index 00000000..bf85f5e5 --- /dev/null +++ b/.github/workflows/python.yml @@ -0,0 +1,62 @@ +name: PyO3-CI + +on: + workflow_dispatch: + push: + branches: + - main + paths: + - candle-pyo3/** + pull_request: + paths: + - candle-pyo3/** + +jobs: + build_and_test: + name: Check everything builds & tests + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest] # For now, only test on Linux + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Install Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + + - name: Install Python + uses: actions/setup-python@v4 + with: + python-version: 3.11 + architecture: "x64" + + - name: Cache Cargo Registry + uses: actions/cache@v1 + with: + path: ~/.cargo/registry + key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} + + - name: Install + working-directory: ./candle-pyo3 + run: | + python -m venv .env + source .env/bin/activate + pip install -U pip + pip install pytest maturin black + python -m maturin develop -r + + - name: Check style + working-directory: ./candle-pyo3 + run: | + source .env/bin/activate + python stub.py --check + black --check . + + - name: Run tests + working-directory: ./candle-pyo3 + run: | + source .env/bin/activate + python -m pytest -s -v tests
\ No newline at end of file |