Feature/issue 176 profiling #142
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: Rust | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| # Add PostgreSQL service container | |
| services: | |
| postgres: | |
| image: postgres:14-alpine | |
| env: | |
| POSTGRES_USER: synapse | |
| POSTGRES_PASSWORD: synapse | |
| POSTGRES_DB: synapse_test # creates the database automatically | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| ports: | |
| - 5432:5432 # maps container's 5432 to host's 5432 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install sqlx-cli | |
| run: cargo install sqlx-cli --no-default-features --features postgres | |
| - name: Run migrations | |
| run: sqlx migrate run | |
| env: | |
| DATABASE_URL: postgres://synapse:synapse@localhost:5432/synapse_test | |
| - name: Build | |
| run: cargo build --verbose | |
| env: | |
| DATABASE_URL: postgres://synapse:synapse@localhost:5432/synapse_test | |
| - name: Run tests | |
| run: cargo test --verbose | |
| env: | |
| DATABASE_URL: postgres://synapse:synapse@localhost:5432/synapse_test |