Skip to content

version-10.9.2

version-10.9.2 #945

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Run tests
on:
push:
branches: [ master ]
pull_request:
jobs:
build:
runs-on: ${{ matrix.os }}
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version:
- '3.12'
- '3.11'
- '3.10'
- '3.9'
- '3.8'
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r tests/requirements.txt
- name: Run static analysis lint
uses: pre-commit/[email protected]
- name: Prepare the API keys & Run pytest
env:
CLARIFAI_USER_EMAIL_SECURE_HOSTING: ${{ secrets.CLARIFAI_USER_EMAIL_SECURE_HOSTING }}
CLARIFAI_USER_EMAIL: ${{ secrets.INTERNAL_USER_EMAIL }}
CLARIFAI_USER_PASSWORD: ${{ secrets.INTERNAL_USER_PASSWORD }}
shell: bash
run: |
export PYTHONPATH=.
export CLARIFAI_USER_ID="$(python scripts/key_for_tests.py --get-userid)"
export CLARIFAI_PAT="$(python scripts/key_for_tests.py --create-pat)"
if [ "${{ github.event.pull_request.head.repo.full_name }}" = "${{ github.repository }}" ]; then
pytest --cov=.
else
pytest -m "not requires_secrets" --cov=.
fi