forked from dottxt-ai/outlines
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Robin Picard
committed
Feb 26, 2025
1 parent
2637b46
commit 0608af4
Showing
1 changed file
with
59 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: Nightly Tests | ||
|
||
on: | ||
pull_request: | ||
branches: [main] | ||
|
||
jobs: | ||
tests: | ||
name: Run the tests | ||
runs-on: ubuntu-latest | ||
env: | ||
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | ||
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} | ||
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }} | ||
DOTTXT_API_KEY: ${{ secrets.DOTTXT_API_KEY }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ["3.10"] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install Ollama | ||
run: | | ||
curl -fsSL https://ollama.com/install.sh | sh | ||
ollama --version | ||
ollama pull tinyllama | ||
- name: Set up test environment | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install uv | ||
uv venv | ||
uv pip install -e .[test] | ||
- name: Create matrix id | ||
id: matrix-id | ||
env: | ||
MATRIX_CONTEXT: ${{ toJson(matrix) }} | ||
run: | | ||
echo $MATRIX_CONTEXT | ||
export MATRIX_ID=`echo $MATRIX_CONTEXT | md5sum | cut -c 1-32` | ||
echo $MATRIX_ID | ||
echo "::set-output name=id::$MATRIX_ID" | ||
- name: Run tests | ||
run: | | ||
uv run pytest -x --cov=outlines | ||
env: | ||
COVERAGE_FILE: .coverage.${{ steps.matrix-id.outputs.id }} | ||
- name: Slack notification on failure | ||
if: failure() | ||
uses: 8398a7/action-slack@v3 | ||
with: | ||
status: ${{ job.status }} | ||
fields: commit,author,ref | ||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_TESTS_ERRORS_WEBHOOK_URL }} |