feat: implement HIGH and MEDIUM performance fixes #121
Workflow file for this run
This file contains hidden or 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: CI | |
| on: | |
| push: | |
| branches: | |
| - master | |
| - main | |
| pull_request: | |
| branches: | |
| - '**' | |
| jobs: | |
| test-make: | |
| name: Test with Make (Python 3.12) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python 3.12 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Install uv | |
| run: | | |
| curl -LsSf https://astral.sh/uv/install.sh | sh | |
| echo "$HOME/.cargo/bin" >> $GITHUB_PATH | |
| - name: Create venv and install dependencies | |
| run: make install | |
| - name: Run lint-check | |
| run: make lint-check | |
| - name: Run tests | |
| run: make test | |
| test-docker: | |
| name: Test with Docker (Python ${{ matrix.python-version }}) | |
| runs-on: ubuntu-latest | |
| needs: test-make | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| python-version: ['3.11', '3.12'] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Build Docker image for testing | |
| run: | | |
| docker build \ | |
| --build-arg PYTHON_VERSION=${{ matrix.python-version }} \ | |
| -t oldp-test:${{ github.sha }}-py${{ matrix.python-version }} \ | |
| . | |
| - name: Run tests in container | |
| run: | | |
| docker run --rm -e DJANGO_CONFIGURATION=TestConfiguration oldp-test:${{ github.sha }}-py${{ matrix.python-version }} python manage.py test | |
| test-es: | |
| name: Test with real Elasticsearch | |
| runs-on: ubuntu-latest | |
| needs: test-make | |
| services: | |
| elasticsearch: | |
| image: docker.elastic.co/elasticsearch/elasticsearch:7.17.12 | |
| env: | |
| discovery.type: single-node | |
| ES_JAVA_OPTS: "-Xms256m -Xmx256m" | |
| xpack.security.enabled: "false" | |
| ports: | |
| - 9200:9200 | |
| options: >- | |
| --health-cmd "curl -f http://localhost:9200/_cluster/health || exit 1" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 10 | |
| --health-start-period 30s | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python 3.12 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Install uv | |
| run: | | |
| curl -LsSf https://astral.sh/uv/install.sh | sh | |
| echo "$HOME/.cargo/bin" >> $GITHUB_PATH | |
| - name: Create venv and install dependencies | |
| run: make install | |
| - name: Run tests with real Elasticsearch | |
| env: | |
| DJANGO_MOCK_ES_TESTS: "False" | |
| run: >- | |
| DJANGO_CONFIGURATION=TestConfiguration | |
| .venv/bin/python manage.py test --tag es | |
| build-docs: | |
| name: Trigger ReadTheDocs Build | |
| runs-on: ubuntu-latest | |
| # Only trigger on pushes to master/main branch | |
| if: github.event_name == 'push' && (github.ref_name == 'master' || github.ref_name == 'main') | |
| steps: | |
| - name: Trigger ReadTheDocs build via webhook | |
| env: | |
| RTDS_WEBHOOK_URL: ${{ secrets.RTDS_WEBHOOK_URL }} | |
| RTDS_WEBHOOK_TOKEN: ${{ secrets.RTDS_WEBHOOK_TOKEN }} | |
| run: | | |
| if [ -z "$RTDS_WEBHOOK_URL" ] || [ -z "$RTDS_WEBHOOK_TOKEN" ]; then | |
| echo "⚠️ ReadTheDocs webhook not configured. Skipping build trigger." | |
| echo "To enable automatic builds:" | |
| echo "1. Go to ReadTheDocs project settings" | |
| echo "2. Enable GitHub integration (Admin → Integrations → GitHub)" | |
| echo "3. Or manually add webhook URL and token as GitHub secrets" | |
| exit 0 | |
| fi | |
| echo "Triggering ReadTheDocs build for branch: ${{ github.ref_name }}" | |
| response=$(curl -X POST -w "\n%{http_code}" \ | |
| -d "branches=${{ github.ref_name }}" \ | |
| -d "token=$RTDS_WEBHOOK_TOKEN" \ | |
| "$RTDS_WEBHOOK_URL") | |
| http_code=$(echo "$response" | tail -n1) | |
| body=$(echo "$response" | head -n-1) | |
| if [ "$http_code" -eq 200 ] || [ "$http_code" -eq 202 ]; then | |
| echo "✅ ReadTheDocs build triggered successfully" | |
| else | |
| echo "⚠️ ReadTheDocs build trigger returned status $http_code" | |
| echo "Response: $body" | |
| echo "Note: If using GitHub integration, ReadTheDocs builds automatically on push" | |
| exit 0 | |
| fi |