Skip to content

Created walkthrough notebook #352

Created walkthrough notebook

Created walkthrough notebook #352

Workflow file for this run

name: CI
on:
push:
branches:
- trunk
pull_request:
branches:
- trunk
env:
NODE_VERSION: 20.11.1
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
lint:
runs-on: ubuntu-latest
strategy:
matrix:
python_version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v2
- name: Setup environment
run: uv venv --python ${{ matrix.python_version }} && source .venv/bin/activate
- name: Install dependencies
run: uv pip install --all-extras -r pyproject.toml
- name: Run pre-commit
run: uvx pre-commit run -a
test:
runs-on: ubuntu-latest
needs: ui-build # requires built frontend assets
strategy:
matrix:
python_version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v2
- name: Setup environment
run: uv venv --python ${{ matrix.python_version }} && source .venv/bin/activate
- name: Install dependencies
run: uv pip install --all-extras -r pyproject.toml
- name: Run unit tests
run: uv run pytest -vv --cov autoarena --cov-report term --cov-report xml:coverage.xml tests/unit
- uses: actions/download-artifact@v4
with:
name: ui-build
path: "./ui/dist"
- name: Install Ollama
run: curl -fsSL https://ollama.com/install.sh | sudo -E sh
- name: Ollama pull qwen2:0.5b model used in tests
run: ollama pull qwen2:0.5b
- name: Configure AWS credentials for Bedrock
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-west-2
- name: Run integration tests
run: |
uv run pytest -vv \
--cov-report term \
--cov-report html \
--cov-report xml:coverage.xml \
--cov autoarena \
--cov-append \
tests/integration
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
COHERE_API_KEY: ${{ secrets.COHERE_API_KEY }}
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
TOGETHER_API_KEY: ${{ secrets.TOGETHER_API_KEY }}
- uses: actions/upload-artifact@v4
if: matrix.python_version == '3.12' # should be the same for all versions, only upload once
with:
name: test-coverage
path: "./htmlcov"
- name: Upload results to Codecov
if: matrix.python_version == '3.12'
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
ui-lint:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ui
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: yarn
cache-dependency-path: "./ui/yarn.lock"
- name: Install dependencies
run: yarn --frozen-lockfile
- name: Run linting
run: yarn lint
ui-build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ui
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: yarn
cache-dependency-path: "./ui/yarn.lock"
- name: Install dependencies
run: yarn --frozen-lockfile
- name: Run build
run: yarn build
- uses: actions/upload-artifact@v4
with:
name: ui-build
path: "./ui/dist"
ui-test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ui
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: yarn
cache-dependency-path: "./ui/yarn.lock"
- name: Install dependencies
run: yarn --frozen-lockfile
- name: Run tests
run: yarn test