Skip to content

updated version

updated version #137

Workflow file for this run

name: Run Tests
on:
push:
branches:
- main
# any branch other than main, will use the test key
- test
workflow_dispatch:
jobs:
setup-and-test:
runs-on: ubuntu-latest
timeout-minutes: 45 # Global timeout fallback
strategy:
fail-fast: false
matrix:
test-suite: [
'unit',
'file_asset',
'data_asset',
'benchmark',
'model',
'pipeline_2.0_v1',
'pipeline_2.0_v2',
'pipeline_3.0_v1',
'pipeline_3.0_v2',
'pipeline_designer',
'pipeline_create',
'finetune_v1',
'finetune_v2',
'general_assets',
'apikey',
'agent',
'team_agent',
]
include:
- test-suite: 'unit'
path: 'tests/unit'
timeout: 45 # Tweaked timeout for each unit tests
- test-suite: 'file_asset'
path: 'tests/functional/file_asset'
timeout: 45
- test-suite: 'data_asset'
path: 'tests/functional/data_asset'
timeout: 45
- test-suite: 'benchmark'
path: 'tests/functional/benchmark'
timeout: 45
- test-suite: 'model'
path: 'tests/functional/model'
timeout: 45
- test-suite: 'pipeline_2.0_v1'
path: 'tests/functional/pipelines/run_test.py --pipeline_version 2.0 --sdk_version v1 --sdk_version_param PipelineFactory'
timeout: 45
- test-suite: 'pipeline_2.0_v2'
path: 'tests/functional/pipelines/run_test.py --pipeline_version 2.0 --sdk_version v2 --sdk_version_param PipelineFactory'
timeout: 45
- test-suite: 'pipeline_3.0_v1'
path: 'tests/functional/pipelines/run_test.py --pipeline_version 3.0 --sdk_version v1 --sdk_version_param PipelineFactory'
timeout: 45
- test-suite: 'pipeline_3.0_v2'
path: 'tests/functional/pipelines/run_test.py --pipeline_version 3.0 --sdk_version v2 --sdk_version_param PipelineFactory'
timeout: 45
- test-suite: 'pipeline_designer'
path: 'tests/functional/pipelines/designer_test.py'
timeout: 45
- test-suite: 'pipeline_create'
path: 'tests/functional/pipelines/create_test.py'
timeout: 45
- test-suite: 'finetune_v1'
path: 'tests/functional/finetune --sdk_version v1 --sdk_version_param FinetuneFactory'
timeout: 45
- test-suite: 'finetune_v2'
path: 'tests/functional/finetune --sdk_version v2 --sdk_version_param FinetuneFactory'
timeout: 45
- test-suite: 'general_assets'
path: 'tests/functional/general_assets'
timeout: 45
- test-suite: 'apikey'
path: 'tests/functional/apikey'
timeout: 45
- test-suite: 'agent'
path: 'tests/functional/agent'
timeout: 45
- test-suite: 'team_agent'
path: 'tests/functional/team_agent'
timeout: 45
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.9"
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ".[test]"
- name: Set environment variables
run: |
if [ "${{ github.ref_name }}" = "main" ]; then
echo "TEAM_API_KEY=${{ secrets.TEAM_API_KEY_PROD }}" >> $GITHUB_ENV
echo "BACKEND_URL=https://platform-api.aixplain.com" >> $GITHUB_ENV
echo "MODELS_RUN_URL=https://models.aixplain.com/api/v1/execute" >> $GITHUB_ENV
echo "PIPELINES_RUN_URL=https://platform-api.aixplain.com/assets/pipeline/execution/run" >> $GITHUB_ENV
else
echo "TEAM_API_KEY=${{ secrets.TEAM_API_KEY }}" >> $GITHUB_ENV
echo "BACKEND_URL=https://test-platform-api.aixplain.com" >> $GITHUB_ENV
echo "MODELS_RUN_URL=https://test-models.aixplain.com/api/v1/execute" >> $GITHUB_ENV
echo "PIPELINES_RUN_URL=https://test-platform-api.aixplain.com/assets/pipeline/execution/run" >> $GITHUB_ENV
fi
echo "SLACK_TOKEN=${{ secrets.SLACK_TOKEN }}" >> $GITHUB_ENV
echo "HF_TOKEN=${{ secrets.HF_TOKEN }}" >> $GITHUB_ENV
- name: Run Tests
timeout-minutes: ${{ matrix.timeout }}
run: python -m pytest ${{ matrix.path }}