Skip to content

fix(data)!: use integer for YAML file version #402

fix(data)!: use integer for YAML file version

fix(data)!: use integer for YAML file version #402

Workflow file for this run

# Continuous integration for all components
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test-quality:
name: Code Quality Checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
enable-cache: true
- name: Set up Python
run: uv python install 3.13
- name: Sync workspace dependencies
run: uv sync --dev
- name: Check code formatting with ruff (library)
working-directory: library
run: |
uv run ruff format --check || {
echo "❌ Code formatting check failed!"
echo "To fix locally, run: cd library && uv run ruff format"
exit 1
}
- name: Lint code with ruff (library)
working-directory: library
run: |
uv run ruff check || {
echo "❌ Linting check failed!"
echo "To fix locally, run: cd library && uv run ruff check --fix"
exit 1
}
- name: Type check with pyright (library)
working-directory: library
run: |
uv run pyright || {
echo "❌ Type checking failed!"
echo "To see errors locally, run: cd library && uv run pyright"
exit 1
}
test-all:
name: Test All Components
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
enable-cache: true
- name: Set up Python
run: uv python install 3.13
- name: Sync workspace dependencies
run: uv sync --dev
- name: Run pytest on all workspace members
run: |
uv run pytest --cov=. --cov-report=xml --cov-report=term-missing || {
echo "❌ Tests failed!"
echo "To run tests locally: uv run pytest"
echo "To run specific component: uv run pytest library/tests"
exit 1
}
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: m-lab/iqb
test-prototype-integration:
name: Test Streamlit Prototype Integration
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
enable-cache: true
- name: Set up Python
run: uv python install 3.13
- name: Sync workspace dependencies
run: uv sync
- name: Test Streamlit app can load
run: |
cd prototype
# Start streamlit in background, wait for it to be ready, then kill it
timeout 10s uv run streamlit run Home.py --server.headless=true --server.port=8501 > /tmp/streamlit.log 2>&1 &
STREAMLIT_PID=$!
# Wait for streamlit to start (max 8 seconds)
for i in {1..8}; do
if grep -q "You can now view your Streamlit app" /tmp/streamlit.log 2>/dev/null; then
echo "✓ Streamlit app started successfully"
kill $STREAMLIT_PID 2>/dev/null || true
exit 0
fi
sleep 1
done
# If we get here, streamlit didn't start properly
echo "✗ Streamlit failed to start"
cat /tmp/streamlit.log
kill $STREAMLIT_PID 2>/dev/null || true
exit 1
test-docker:
name: Test Docker Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build Docker image
run: docker build -f prototype/Dockerfile -t iqb-prototype:test .
- name: Run container
run: |
# Start container in background
docker run -d -p 8501:8501 --name iqb-test iqb-prototype:test
# Wait for Streamlit to start (max 30 seconds)
for i in {1..30}; do
if docker logs iqb-test 2>&1 | grep -q "You can now view your Streamlit app"; then
echo "✓ Streamlit started successfully in container"
break
fi
if [ $i -eq 30 ]; then
echo "✗ Streamlit failed to start in container"
docker logs iqb-test
exit 1
fi
sleep 1
done
- name: Check for errors in logs
run: |
if docker logs iqb-test 2>&1 | grep -iE "(error|exception|traceback)"; then
echo "✗ Errors found in container logs"
exit 1
fi
echo "✓ No errors in container logs"
- name: Stop container
if: always()
run: docker stop iqb-test && docker rm iqb-test