use openai functions (#112) #267
This file contains hidden or 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
name: CI | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
permissions: | |
checks: write | |
contents: read | |
actions: read | |
pull-requests: write | |
jobs: | |
lint: | |
name: Lint and Format Check | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.13' # Use a specific version for linting | |
cache: 'pip' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -e .[dev] | |
pip install ruff | |
- name: Run Ruff Linter | |
run: ruff check . | |
- name: Run Ruff Formatter Check | |
run: ruff format --check . | |
test: | |
name: Python ${{ matrix.python-version }} Test | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: [3.12, 3.13] | |
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: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -e .[dev] | |
pip install pytest pytest-cov pytest-asyncio pytest-mock pytest-github-actions-annotate-failures mongomock | |
- name: Run tests with pytest | |
run: | | |
mkdir -p junit | |
pytest --junitxml=junit/test-results-${{ matrix.python-version }}.xml --cov=solana_agent --cov-report=xml --cov-report=term tests/ | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v5 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
- name: Publish Test Results | |
uses: EnricoMi/publish-unit-test-result-action@v2 | |
if: always() | |
with: | |
check_name: "Test Results" | |
files: junit/test-results-${{ matrix.python-version }}.xml | |
- name: Upload test results | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: test-results-${{ matrix.python-version }} | |
path: junit/*.xml | |
- name: Create Status Check | |
uses: LouisBrunner/checks-action@v2.0.0 | |
if: always() | |
with: | |
token: ${{ github.token }} | |
name: "Python Tests" | |
conclusion: ${{ job.status }} | |
output: | | |
{"summary":"Python ${{ matrix.python-version }} test results"} |