Skip to content

NFT functions for general agent (#582) #1343

NFT functions for general agent (#582)

NFT functions for general agent (#582) #1343

Workflow file for this run

name: Python CI
on:
pull_request:
push:
branches: [main]
workflow_dispatch:
env:
MANIFOLD_API_KEY: ${{ secrets.MANIFOLD_API_KEY }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
BET_FROM_PRIVATE_KEY: ${{ secrets.BET_FROM_PRIVATE_KEY }}
GRAPH_API_KEY: ${{ secrets.GRAPH_API_KEY }}
PINECONE_API_KEY: ${{ secrets.PINECONE_API_KEY }}
jobs:
mypy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/python_prepare
- name: Run mypy
run: poetry run mypy
pytest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/python_prepare
- name: Run pytest
run: poetry run pytest tests
pytest-docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Extract environment variables for Docker container
run: |
echo "MANIFOLD_API_KEY=${{ secrets.MANIFOLD_API_KEY }}" >> .env
echo "OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }}" >> .env
echo "BET_FROM_PRIVATE_KEY=${{ secrets.BET_FROM_PRIVATE_KEY }}" >> .env
echo "GRAPH_API_KEY=${{ secrets.GRAPH_API_KEY }}" >> .env
echo "PINECONE_API_KEY=${{ secrets.PINECONE_API_KEY }}" >> .env
- name: Build Dockerimage
run: make build
- name: Run pytest in Docker
run: make tests-docker
pytest-paid:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/python_prepare
- name: Run pytest
run: poetry run pytest tests
env:
RUN_PAID_TESTS: "1"
if: github.event_name == 'workflow_dispatch'
test-build-image:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Build and push Docker image
uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56
with:
push: false
black:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/python_prepare
- name: Check with black
run: poetry run black --check .
autoflake:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/python_prepare
- name: Check with autoflake
run: |
poetry run autoflake --in-place --remove-all-unused-imports --remove-unused-variables --recursive .
git diff --exit-code --quiet || exit 1
isort:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/python_prepare
- name: Check with isort
run: |
poetry run isort --profile black .
git diff --exit-code --quiet || exit 1