Add GitHub handle support #8
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 CI | |
| on: | |
| push: | |
| branches: [main, dev] | |
| pull_request: | |
| jobs: | |
| backend_tests: | |
| name: Backend Tests | |
| runs-on: ubuntu-latest | |
| services: | |
| postgres: | |
| image: postgres:15 | |
| env: | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: postgres | |
| POSTGRES_DB: guild_genesis_test | |
| 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/guild_genesis_test | |
| TEST_MODE: "1" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: actions-rs/toolchain@v1 | |
| with: | |
| toolchain: stable | |
| override: true | |
| - name: Cache cargo | |
| uses: actions/cache@v3 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }} | |
| - name: Cache sqlx-data | |
| uses: actions/cache@v3 | |
| with: | |
| path: .sqlx | |
| key: ${{ runner.os }}-sqlx-${{ hashFiles('backend/Cargo.toml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-sqlx- | |
| - name: Install sqlx-cli | |
| run: cargo install sqlx-cli --no-default-features --features postgres,rustls | |
| - name: Prepare sqlx | |
| run: | | |
| cd backend | |
| cargo sqlx prepare | |
| - name: Run migrations | |
| run: | | |
| cd backend | |
| sqlx migrate run | |
| - name: Run tests | |
| run: | | |
| cd backend | |
| cargo test -- --nocapture |