fix(quota): project credit-backed probe state #125
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: ci-${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| MIX_ENV: test | |
| POSTGRES_HOST: localhost | |
| POSTGRES_PORT: 5433 | |
| POSTGRES_DB: codex_pooler_dev | |
| POSTGRES_TEST_DB: codex_pooler_test | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: postgres | |
| jobs: | |
| phoenix: | |
| runs-on: ubuntu-latest | |
| services: | |
| db: | |
| image: postgres:18 | |
| env: | |
| POSTGRES_DB: codex_pooler_dev | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: postgres | |
| ports: | |
| - 5433:5432 | |
| options: >- | |
| --health-cmd "pg_isready -U postgres -d codex_pooler_dev" | |
| --health-interval 5s | |
| --health-timeout 5s | |
| --health-retries 20 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Setup Erlang and Elixir | |
| uses: erlef/setup-beam@v1 | |
| with: | |
| otp-version: '28.5' | |
| elixir-version: '1.19.5' | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: '26.2.0' | |
| cache: npm | |
| cache-dependency-path: assets/package-lock.json | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y --no-install-recommends ripgrep | |
| - name: Cache Mix deps | |
| uses: actions/cache@v5 | |
| with: | |
| path: deps | |
| key: ${{ runner.os }}-mix-${{ hashFiles('mix.lock') }} | |
| restore-keys: ${{ runner.os }}-mix- | |
| - name: Cache Mix build | |
| uses: actions/cache@v5 | |
| with: | |
| path: _build | |
| key: ${{ runner.os }}-build-${{ env.MIX_ENV }}-${{ hashFiles('mix.lock') }} | |
| restore-keys: ${{ runner.os }}-build-${{ env.MIX_ENV }}- | |
| - name: Install dependencies | |
| run: mix deps.get | |
| - name: Install asset dependencies | |
| env: | |
| NPM_CONFIG_UPDATE_NOTIFIER: "false" | |
| run: npm ci --prefix assets | |
| - name: Check formatting | |
| run: mix format --check-formatted | |
| - name: Compile with warnings as errors | |
| run: mix compile --warnings-as-errors | |
| - name: Create test database | |
| run: mix ecto.create --quiet | |
| - name: Migrate test database | |
| run: mix ecto.migrate --quiet | |
| - name: Run tests | |
| run: mix test | |
| - name: Build deploy assets | |
| run: mix assets.deploy | |
| - name: Build Docker image | |
| run: docker build . |