Experimental: Improvements with the GPT-5.5-Medium Reasoning for the Zerodha 10x benchmarks #160
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/CD Pipeline | |
| on: | |
| push: | |
| branches: ["main", "master"] | |
| tags: ["v*"] | |
| paths: | |
| - "**" | |
| pull_request: | |
| branches: ["*"] | |
| paths: | |
| - "**" | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| inputs: | |
| run_mode: | |
| description: "Choose whether to run regular CI, build release artifacts, or publish to PyPI" | |
| required: true | |
| default: full-ci | |
| type: choice | |
| options: | |
| - full-ci | |
| - build-python-artifacts | |
| - publish-pypi | |
| jobs: | |
| backend-lint: | |
| name: Backend Lint | |
| if: ${{ github.event_name == 'pull_request' || (github.event_name == 'push' && !startsWith(github.ref, 'refs/tags/')) || (github.event_name == 'workflow_dispatch' && inputs.run_mode == 'full-ci') }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version: "1.26.4" | |
| cache: false | |
| - name: golangci-lint | |
| uses: golangci/golangci-lint-action@v6 | |
| with: | |
| version: v1.64.8 | |
| install-mode: goinstall | |
| args: -E revive,gocritic,gocyclo,goconst ./... | |
| backend-test: | |
| name: Backend Test | |
| if: ${{ github.event_name == 'pull_request' || (github.event_name == 'push' && !startsWith(github.ref, 'refs/tags/')) || (github.event_name == 'workflow_dispatch' && inputs.run_mode == 'full-ci') }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version: "1.26.4" | |
| cache: true | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| cache: "pip" | |
| cache-dependency-path: bindings/python/pyproject.toml | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y openjdk-11-jre-headless unzip curl \ | |
| fonts-liberation fonts-dejavu-core fonts-noto-core | |
| - name: Install Python test dependencies | |
| run: pip install pytest | |
| - name: Install veraPDF | |
| run: make install-verapdf | |
| - name: Run make test | |
| run: make test | |
| frontend-lint: | |
| name: Frontend Lint | |
| needs: backend-lint | |
| if: ${{ github.event_name == 'pull_request' || (github.event_name == 'push' && !startsWith(github.ref, 'refs/tags/')) || (github.event_name == 'workflow_dispatch' && inputs.run_mode == 'full-ci') }} | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: ./frontend | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "18" | |
| cache: "npm" | |
| cache-dependency-path: frontend/package-lock.json | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run Lint | |
| run: npm run lint | |
| python-build: | |
| name: Python Build | |
| if: ${{ always() && (github.event_name == 'release' || (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')) || (github.event_name == 'workflow_dispatch' && (inputs.run_mode == 'build-python-artifacts' || inputs.run_mode == 'publish-pypi'))) }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version: "1.22" | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Clean generated Python packaging outputs | |
| shell: bash | |
| run: | | |
| rm -rf bindings/python/build bindings/python/dist bindings/python/*.egg-info | |
| - name: Build shared library | |
| shell: bash | |
| run: | | |
| cd bindings/python | |
| ./build.sh | |
| - name: Build source distribution | |
| if: ${{ matrix.os == 'ubuntu-latest' }} | |
| shell: bash | |
| run: | | |
| cd bindings/python | |
| pip install build | |
| python -m build --sdist | |
| - name: Build wheel | |
| if: ${{ matrix.os != 'ubuntu-latest' }} | |
| shell: bash | |
| run: | | |
| cd bindings/python | |
| pip install build | |
| python -m build --wheel | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: dist-${{ matrix.os }} | |
| path: bindings/python/dist/ | |
| build-and-commit-frontend: | |
| name: Frontend Build and Commit | |
| needs: [frontend-lint, backend-test] | |
| if: ${{ github.event_name == 'pull_request' || (github.event_name == 'push' && !startsWith(github.ref, 'refs/tags/')) || (github.event_name == 'workflow_dispatch' && inputs.run_mode == 'full-ci') }} | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event_name == 'pull_request' && github.head_ref || github.ref_name }} | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| cache: "npm" | |
| cache-dependency-path: frontend/package-lock.json | |
| - name: Install dependencies | |
| run: cd frontend && npm ci | |
| - name: Build frontend | |
| env: | |
| VITE_GOOGLE_CLIENT_ID: ${{ secrets.VITE_GOOGLE_CLIENT_ID }} | |
| GOOGLE_CLIENT_ID: ${{ secrets.VITE_GOOGLE_CLIENT_ID }} | |
| run: | | |
| export VITE_IS_CLOUD_RUN=true | |
| export VITE_ENVIRONMENT=cloudrun | |
| export VITE_CLOUD_RUN_URL=https://gopdfsuit.ue.r.appspot.com | |
| export VITE_API_URL=https://gopdfsuit.ue.r.appspot.com | |
| export CLOUD_RUN_SERVICE_URL=https://gopdfsuit.ue.r.appspot.com | |
| export DISABLE_PROFILING=true | |
| cd frontend && npm run build | |
| - name: Commit and push changes | |
| uses: stefanzweifel/git-auto-commit-action@v5 | |
| with: | |
| commit_message: "chore: auto-build frontend [skip ci]" | |
| file_pattern: "docs/**" | |
| commit_author: "github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>" | |
| publish-pypi: | |
| name: Publish to PyPI | |
| needs: python-build | |
| if: ${{ needs.python-build.result == 'success' && ((github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')) || github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && inputs.run_mode == 'publish-pypi')) }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: dist | |
| pattern: dist-* | |
| merge-multiple: true | |
| - name: Check whether version is already on PyPI | |
| id: pypi-check | |
| shell: bash | |
| run: | | |
| version=$(grep -E '^version = ' bindings/python/pyproject.toml | head -n 1 | cut -d '"' -f 2) | |
| if curl --silent --fail "https://pypi.org/pypi/pypdfsuit/${version}/json" > /dev/null; then | |
| echo "already_published=true" >> "$GITHUB_OUTPUT" | |
| echo "Version ${version} is already published on PyPI." | |
| else | |
| echo "already_published=false" >> "$GITHUB_OUTPUT" | |
| echo "Version ${version} is not on PyPI yet." | |
| fi | |
| - name: Prune stale or unsupported distributions | |
| if: ${{ steps.pypi-check.outputs.already_published != 'true' }} | |
| shell: bash | |
| run: | | |
| version=$(grep -E '^version = ' bindings/python/pyproject.toml | head -n 1 | cut -d '"' -f 2) | |
| find dist -maxdepth 1 -type f ! -name "pypdfsuit-${version}*" -delete | |
| find dist -maxdepth 1 -type f -name '*linux_*.whl' -delete | |
| ls -1 dist | |
| - name: Publish package to PyPI | |
| if: ${{ steps.pypi-check.outputs.already_published != 'true' }} | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| password: ${{ secrets.PYPI_API_TOKEN }} | |
| packages-dir: dist/ |