Skip to content
Open
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
45 changes: 45 additions & 0 deletions .github/workflows/nix-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Nix Checks

on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]

jobs:
nix-checks:
runs-on:
group: aws-general-8-plus
steps:
- uses: actions/checkout@v4

- uses: cachix/install-nix-action@v27
with:
nix_path: nixpkgs=channel:nixos-unstable

- name: Setup Cachix
uses: cachix/cachix-action@v14
with:
name: text-generation-inference
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
env:
USER: github_runner

- name: Run Nix Checks
run: |
# Run checks for all Python versions with stable Rust
nix flake check

# Build the development shell to ensure it works
nix develop -c echo "Development shell works!"

- name: Cache Nix store
uses: actions/cache@v4
with:
path: |
/nix/store
/nix/var/nix/db
~/.cache/nix
key: ${{ runner.os }}-nix-${{ hashFiles('flake.lock') }}
restore-keys: |
${{ runner.os }}-nix-
72 changes: 72 additions & 0 deletions .github/workflows/test_hf_transfer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Test hf_transfer

on:
push:
branches:
- main
- master
tags:
- '*'
pull_request:
workflow_dispatch:

permissions:
contents: read

jobs:
test:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
rust-version: ['stable', 'nightly']
exclude:
- os: macos-latest
rust-version: nightly
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'

- name: Set up Rust ${{ matrix.rust-version }}
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust-version }}
components: rustfmt, clippy

- name: Install system dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y pkg-config libssl-dev

- name: Install system dependencies
if: runner.os == 'macOS'
run: |
brew install pkg-config openssl

- name: Create virtual environment
run: python -m venv .venv

- name: Install dependencies
run: |
source .venv/bin/activate
pip install --upgrade pip
pip install maturin pytest
maturin develop

- name: Run tests
run: |
source .venv/bin/activate
pytest tests/ -v

- name: Run clippy
run: cargo clippy --all-targets --all-features -- -D warnings

- name: Run rustfmt
run: cargo fmt --all -- --check
Loading