metrics listen on a different port #27
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: sqlx-prepare | |
| on: | |
| push: | |
| branches: ["**"] | |
| paths: | |
| - "backend/**" | |
| - ".sqlx/**" | |
| pull_request: | |
| paths: | |
| - "backend/**" | |
| - ".sqlx/**" | |
| jobs: | |
| sqlx-prepare: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| services: | |
| postgres: | |
| image: postgres:16 | |
| env: | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: postgres | |
| POSTGRES_DB: app | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd "pg_isready -U postgres" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| env: | |
| DATABASE_URL: postgres://postgres:postgres@localhost:5432/app | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Install sqlx-cli | |
| run: cargo install sqlx-cli --no-default-features --features native-tls,postgres | |
| - name: Run migrations | |
| run: cargo sqlx migrate run --source backend/migrations | |
| - name: Validate sqlx cache | |
| run: cargo sqlx prepare --check --workspace | |
| - name: Commit sqlx cache updates | |
| if: github.event_name == 'push' | |
| env: | |
| GIT_AUTHOR_NAME: ${{ secrets.GIT_AUTHOR_NAME }} | |
| GIT_AUTHOR_EMAIL: ${{ secrets.GIT_AUTHOR_EMAIL }} | |
| GIT_COMMITTER_NAME: ${{ secrets.GIT_AUTHOR_NAME }} | |
| GIT_COMMITTER_EMAIL: ${{ secrets.GIT_AUTHOR_EMAIL }} | |
| run: | | |
| if git status --porcelain .sqlx | grep -q .; then | |
| git add .sqlx | |
| git commit -m "chore(sqlx): refresh query cache" | |
| git push | |
| fi |