chore(data): coordinate edit for 5505.02.534, 5505.02.535
#714
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: autofix.ci | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-openapi | |
| cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | |
| on: | |
| pull_request: | |
| branches: [ main ] | |
| paths: | |
| - 'server/src/**' | |
| pull_request_target: | |
| types: [ labeled ] | |
| branches: [ main ] | |
| permissions: {} | |
| jobs: | |
| update-server-snapshots: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Setup | Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: {persist-credentials: false} | |
| - name: Install cargo-insta | |
| uses: taiki-e/install-action@fa0dd4cd0a40696e6f9766370614a5ce482e6aa8 # v2.77.5 | |
| with: | |
| tool: cargo-insta | |
| - name: Update server snapshots | |
| run: cargo insta test --accept | |
| continue-on-error: true | |
| - uses: autofix-ci/action@c5b2d67aa2274e7b5a18224e8171550871fc7e4a # v1.3.4 | |
| with: | |
| commit-message: "chore: Update server snapshots" | |
| sort-cargo-toml: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Setup | Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: {persist-credentials: false} | |
| - name: Install cargo-sort | |
| uses: taiki-e/install-action@fa0dd4cd0a40696e6f9766370614a5ce482e6aa8 # v2.77.5 | |
| with: | |
| tool: cargo-sort | |
| - name: Sort Cargo.toml | |
| run: cargo sort | |
| - uses: autofix-ci/action@c5b2d67aa2274e7b5a18224e8171550871fc7e4a # v1.3.4 | |
| with: | |
| commit-message: "chore: sort Cargo.toml" | |
| update-screenshots: | |
| runs-on: ubuntu-latest | |
| if: contains(github.event.pull_request.labels.*.name, 'bless') | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: BRAINSia/free-disk-space@7048ffbf50819342ac964ef3998a51c2564a8a75 # v2.1.3 | |
| with: | |
| tool-cache: false | |
| mandb: true | |
| android: true | |
| dotnet: true | |
| haskell: true | |
| large-packages: true | |
| docker-images: true | |
| swap-storage: true | |
| - name: Setup | Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: {persist-credentials: false} | |
| - name: Setup | Pull Docker images | |
| run: docker compose pull | |
| - name: Setup | Build Docker images | |
| run: docker compose -f compose.local.yml build | |
| - name: Setup | pnpm | |
| uses: pnpm/action-setup@08c4be7e2e672a47d11bd04269e27e5f3e8529cb # v6.0.0 | |
| with: | |
| version: 10.14.0 | |
| package_json_file: tests/package.json | |
| run_install: | | |
| - cwd: tests | |
| args: [--frozen-lockfile] | |
| - name: Install Browser | |
| working-directory: tests | |
| run: pnpm exec playwright install --with-deps chromium | |
| - name: Setup | Create .env file for docker-compose | |
| run: | | |
| cat > .env << EOF | |
| POSTGRES_PASSWORD=test_password | |
| POSTGRES_USER=postgres | |
| POSTGRES_DB=navigatum_test | |
| MEILI_MASTER_KEY=test_master_key | |
| LOG_LEVEL=debug | |
| EOF | |
| - name: Setup | Start Docker services | |
| run: | | |
| docker compose -f compose.local.yml up -d | |
| echo "Waiting for services to be healthy..." | |
| timeout 120 bash -c 'until curl -f http://localhost:3003/api/locations/mi; do sleep 2; done' | |
| timeout 120 bash -c 'until curl -f http://localhost:3003/api/search?q=MI; do sleep 2; done' | |
| timeout 120 bash -c 'until curl -f http://localhost:3000/; do sleep 2; done' | |
| - name: Update | Screenshots | |
| run: pnpm run update-screenshots | |
| working-directory: tests | |
| env: | |
| BASE_URL: http://localhost:3000 | |
| SKIP_WEBSERVER: true | |
| - name: Restore | Discard test-only side-effects (.env, lockfile) | |
| run: git checkout -- .env tests/pnpm-lock.yaml | |
| - uses: autofix-ci/action@c5b2d67aa2274e7b5a18224e8171550871fc7e4a # v1.3.4 | |
| with: | |
| commit-message: "chore: update screenshots" | |
| update-openapi: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| services: | |
| postgres: | |
| image: postgis/postgis:18-3.6 | |
| env: | |
| POSTGRES_PASSWORD: postgres | |
| POSTGRES_USER: postgres | |
| POSTGRES_DB: navigatum | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| steps: | |
| - run: rustup update stable && rustup default stable | |
| - name: Setup | Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: {persist-credentials: false} | |
| - name: Setup | Rust-Cache | |
| uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1 | |
| with: | |
| workspaces: | | |
| server | |
| - name: Setup | Install yq for YAML conversion | |
| run: | | |
| curl -L https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -o /usr/local/bin/yq | |
| sudo chmod +x /usr/local/bin/yq | |
| - name: Setup | pnpm | |
| uses: pnpm/action-setup@08c4be7e2e672a47d11bd04269e27e5f3e8529cb # v6.0.0 | |
| with: | |
| version: 10.14.0 | |
| package_json_file: webclient/package.json | |
| run_install: | | |
| - cwd: webclient | |
| args: [--frozen-lockfile] | |
| - name: Build | Compile server | |
| working-directory: server | |
| run: cargo build | |
| env: | |
| CARGO_INCREMENTAL: 0 | |
| - name: Run | Start server in background | |
| working-directory: server | |
| run: cargo run & | |
| env: | |
| CARGO_INCREMENTAL: 0 | |
| SKIP_MS_SETUP: true | |
| SKIP_DB_SETUP: true | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: postgres | |
| POSTGRES_URL: localhost | |
| POSTGRES_DB: navigatum | |
| LOG_LEVEL: info | |
| - name: Wait | Server startup | |
| run: | | |
| echo "Waiting for server to start..." | |
| timeout=60 | |
| count=0 | |
| until curl -f http://localhost:3003/api/status > /dev/null 2>&1; do | |
| if [ $count -ge $timeout ]; then | |
| echo "Server failed to start within $timeout seconds" | |
| exit 1 | |
| fi | |
| echo "Waiting for server to be ready... ($count/$timeout)" | |
| sleep 1 | |
| count=$((count + 1)) | |
| done | |
| echo "Server is ready!" | |
| - name: Fetch | Download OpenAPI spec | |
| run: | | |
| echo "Fetching OpenAPI spec from server..." | |
| curl -f http://localhost:3003/api/openapi.json -o openapi.json | |
| echo "Converting JSON to YAML..." | |
| yq -Poy openapi.json > data/output/openapi.yaml | |
| echo "Cleaning up temporary file..." | |
| rm openapi.json | |
| - name: Update | Refresh types | |
| run: pnpm run type-refresh | |
| working-directory: webclient | |
| continue-on-error: true | |
| - name: Restore | Discard lockfile side-effects from pnpm | |
| run: git checkout -- webclient/pnpm-lock.yaml | |
| - uses: autofix-ci/action@c5b2d67aa2274e7b5a18224e8171550871fc7e4a # v1.3.4 | |
| with: | |
| commit-message: "chore: Update OpenAPI spec and types" | |
| # This final step is needed to mark the whole workflow as successful | |
| # Don't change its name - it is used by the merge protection rules | |
| done: | |
| name: Finished autofix | |
| runs-on: ubuntu-latest | |
| needs: [ update-server-snapshots, sort-cargo-toml, update-openapi, update-screenshots ] | |
| if: always() | |
| permissions: {} | |
| steps: | |
| - name: Result of the needed steps | |
| run: echo "${{ toJSON(needs) }}" # zizmor: ignore[template-injection] | |
| - if: ${{ contains(needs.*.result, 'failure') }} | |
| name: CI Result | |
| run: exit 1 |