Python Checks #26
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 Checks | |
on: | |
# Runs at every push on main | |
push: | |
branches: main | |
# Runs at every pull request | |
pull_request: | |
types: [opened, synchronize, review_requested, reopened] | |
# Runs at every pull request review | |
pull_request_review: | |
types: submitted | |
# Runs manually via Run Workflow in GitHub Actions | |
workflow_dispatch: | |
# Runs every Monday at 12:00 UTC | |
schedule: | |
- cron: '0 12 * * 1' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
# Python | |
- name: Install Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.11" | |
cache: 'pip' | |
# Dependencies | |
- name: Install Dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r base-requirements.txt | |
pip install ruff mypy | |
# Ruff | |
- name: Ruff | |
run: | | |
ruff check --output-format=github . | |
ruff check --select I --output-format=github . | |
# MyPy | |
- name: MyPy | |
run: mypy --explicit-package-bases . | |
# # Set PYTHONPATH | |
# - name: Set PYTHONPATH | |
# run: echo "PYTHONPATH=$(pwd)" >> $GITHUB_ENV | |
# # Runs only at every pull request commit for the Financial Assistant | |
# - name: Run Unit Tests at Pull Request | |
# if: github.event_name == 'pull_request' || github.event_name != 'pull_request_review' | |
# env: | |
# SAMBANOVA_API_KEY: ${{ secrets.SAMBANOVA_API_KEY }} | |
# run: | | |
# python financial_assistant/tests/github_pull_request_test.py | |
# # Runs weekly | |
# - name: Run Unit Tests Weekly and Pre-Merge | |
# if: github.event_name == 'schedule' || github.event_name == 'pull_request_review' | |
# env: | |
# SAMBANOVA_API_KEY: ${{ secrets.SAMBANOVA_API_KEY }} | |
# run: | | |
# python financial_assistant/tests/financial_assistant_test.py |