feat(mcp): add docs query server #229
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: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| OTP_VERSION: "27.2.1" | |
| ELIXIR_VERSION: "1.18.2" | |
| jobs: | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 15 | |
| permissions: | |
| contents: read | |
| env: | |
| MIX_ENV: dev | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Setup Elixir | |
| uses: erlef/setup-beam@v1 | |
| with: | |
| otp-version: ${{ env.OTP_VERSION }} | |
| elixir-version: ${{ env.ELIXIR_VERSION }} | |
| - name: Install Hex/Rebar | |
| run: | | |
| set -euo pipefail | |
| mix local.hex --force | |
| mix local.rebar --force | |
| - name: Restore Hex/Mix cache | |
| uses: actions/cache@v5 | |
| with: | |
| path: | | |
| ~/.hex | |
| ~/.mix | |
| key: ${{ runner.os }}-beamtools-${{ hashFiles('mix.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-beamtools- | |
| - name: Restore dependencies cache | |
| uses: actions/cache@v5 | |
| id: deps-cache | |
| with: | |
| path: | | |
| deps | |
| _build | |
| key: ${{ runner.os }}-mix-dev-otp${{ env.OTP_VERSION }}-elixir${{ env.ELIXIR_VERSION }}-${{ hashFiles('mix.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-mix-dev-otp${{ env.OTP_VERSION }}-elixir${{ env.ELIXIR_VERSION }}- | |
| - name: Remove cached rebar3 build artifacts in deps | |
| if: steps.deps-cache.outputs.cache-hit != 'true' | |
| run: | | |
| if [ -d deps ]; then | |
| find deps -maxdepth 6 -type d \( -name _build -o -name .rebar3 \) -prune -exec rm -rf {} + || true | |
| find deps -maxdepth 6 -type f -name rebar3.crashdump -delete || true | |
| fi | |
| - name: Install dependencies | |
| run: mix deps.get | |
| - name: Compile dependencies | |
| if: steps.deps-cache.outputs.cache-hit != 'true' | |
| run: mix deps.compile | |
| - name: Run lint checks | |
| run: mix format --check-formatted && mix compile --warnings-as-errors && mix credo --min-priority higher | |
| - name: Check for unused dependencies | |
| run: mix deps.unlock --check-unused | |
| - name: Audit Hex dependencies | |
| run: mix hex.audit | |
| test: | |
| name: Test | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 15 | |
| permissions: | |
| contents: read | |
| env: | |
| MIX_ENV: test | |
| POSTGRES_HOST: localhost | |
| POSTGRES_PORT: 5432 | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: postgres | |
| POSTGRES_DB: test_db | |
| services: | |
| postgres: | |
| image: pgvector/pgvector:pg16 | |
| env: | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: postgres | |
| POSTGRES_DB: test_db | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd "pg_isready -U postgres -d test_db" | |
| --health-interval 5s | |
| --health-timeout 3s | |
| --health-retries 20 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Setup Elixir | |
| uses: erlef/setup-beam@v1 | |
| with: | |
| otp-version: ${{ env.OTP_VERSION }} | |
| elixir-version: ${{ env.ELIXIR_VERSION }} | |
| - name: Install Hex/Rebar | |
| run: | | |
| set -euo pipefail | |
| mix local.hex --force | |
| mix local.rebar --force | |
| - name: Restore Hex/Mix cache | |
| uses: actions/cache@v5 | |
| with: | |
| path: | | |
| ~/.hex | |
| ~/.mix | |
| key: ${{ runner.os }}-beamtools-${{ hashFiles('mix.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-beamtools- | |
| - name: Restore dependencies cache | |
| uses: actions/cache@v5 | |
| id: deps-cache | |
| with: | |
| path: | | |
| deps | |
| _build | |
| key: ${{ runner.os }}-mix-test-otp${{ env.OTP_VERSION }}-elixir${{ env.ELIXIR_VERSION }}-${{ hashFiles('mix.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-mix-test-otp${{ env.OTP_VERSION }}-elixir${{ env.ELIXIR_VERSION }}- | |
| - name: Remove cached rebar3 build artifacts in deps | |
| if: steps.deps-cache.outputs.cache-hit != 'true' | |
| run: | | |
| if [ -d deps ]; then | |
| find deps -maxdepth 6 -type d \( -name _build -o -name .rebar3 \) -prune -exec rm -rf {} + || true | |
| find deps -maxdepth 6 -type f -name rebar3.crashdump -delete || true | |
| fi | |
| - name: Install dependencies | |
| run: mix deps.get | |
| - name: Compile dependencies | |
| if: steps.deps-cache.outputs.cache-hit != 'true' | |
| run: mix deps.compile | |
| - name: Setup database | |
| run: mix ecto.setup | |
| env: | |
| DATABASE_URL: postgres://${{ env.POSTGRES_USER }}:${{ env.POSTGRES_PASSWORD }}@${{ env.POSTGRES_HOST }}:${{ env.POSTGRES_PORT }}/${{ env.POSTGRES_DB }} | |
| - name: Run tests | |
| run: mix test |