Fix protobuf (#7) #15
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
name: Python CI | |
on: | |
pull_request: | |
push: | |
branches: [main] | |
workflow_dispatch: | |
env: | |
MANIFOLD_API_KEY: ${{ secrets.MANIFOLD_API_KEY }} | |
SERP_API_KEY: ${{ secrets.SERP_API_KEY }} | |
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
BET_FROM_PRIVATE_KEY: ${{ secrets.BET_FROM_PRIVATE_KEY }} | |
jobs: | |
mypy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: ./.github/actions/python_prepare | |
- name: Run mypy | |
run: poetry run mypy | |
pytest: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: ./.github/actions/python_prepare | |
- name: Run pytest | |
run: poetry run pytest | |
pytest-paid: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: ./.github/actions/python_prepare | |
- name: Run pytest | |
run: poetry run pytest | |
env: | |
RUN_PAID_TESTS: "1" | |
if: github.event_name == 'workflow_dispatch' | |
# TODO: Remove once the environment variables are fixed in the new repository. | |
continue-on-error: true | |
black: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: ./.github/actions/python_prepare | |
- name: Check with black | |
run: poetry run black --check . | |
autoflake: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- 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@v2 | |
- uses: ./.github/actions/python_prepare | |
- name: Check with isort | |
run: | | |
poetry run isort --profile black . | |
git diff --exit-code --quiet || exit 1 | |
build-image-test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
# This step uses the `docker/build-push-action` action to build the image, based on your repository's `Dockerfile`. | |
- name: Build and push Docker image | |
uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56 | |
with: | |
push: false |