Skip to content

austin/match-ts-parity #5

austin/match-ts-parity

austin/match-ts-parity #5

name: Integration Tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
integration-tests:
runs-on: ubuntu-latest
needs: [] # Run in parallel with other workflows
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install dependencies
run: |
pip install ".[dev]"
- name: Check for API key
id: check-api-key
env:
NUTRIENT_API_KEY: ${{ secrets.NUTRIENT_API_KEY }}
run: |
if [ -n "$NUTRIENT_API_KEY" ] && [ "$NUTRIENT_API_KEY" != "fake_key" ] && [ ${#NUTRIENT_API_KEY} -gt 10 ]; then
echo "has_api_key=true" >> $GITHUB_OUTPUT
echo "✅ Valid API key detected"
else
echo "has_api_key=false" >> $GITHUB_OUTPUT
echo "⏭️ No valid API key - Integration tests will be skipped"
fi
- name: Run integration tests
if: steps.check-api-key.outputs.has_api_key == 'true'
env:
NUTRIENT_API_KEY: ${{ secrets.NUTRIENT_API_KEY }}
run: python -m pytest tests/test_integration.py -v
- name: Skip integration tests (no API key)
if: steps.check-api-key.outputs.has_api_key == 'false'
run: |
echo "✅ Integration tests skipped - no valid API key available"
echo "This is expected for forks and external PRs"