From 736220a94e93b11eea5100fbd59f80266c906a19 Mon Sep 17 00:00:00 2001 From: Paul Makles Date: Sat, 22 Apr 2023 16:03:08 +0100 Subject: [PATCH] ci: run tests with and without MongoDB --- .github/workflows/rust.yaml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/rust.yaml b/.github/workflows/rust.yaml index c7f57608..cad2a73f 100644 --- a/.github/workflows/rust.yaml +++ b/.github/workflows/rust.yaml @@ -32,16 +32,23 @@ jobs: with: command: test - - name: Copy .env.example - if: github.event_name != 'pull_request' - run: | - cp .env.example .env - - name: Run services in background if: github.event_name != 'pull_request' run: | docker-compose -f docker-compose.db.yml up -d + - name: Run cargo test (with MongoDB) + uses: actions-rs/cargo@v1 + env: + MONGODB: mongodb://localhost + with: + command: test + + - name: Copy .env.example + if: github.event_name != 'pull_request' + run: | + cp .env.example .env + - name: Start API in background if: github.event_name != 'pull_request' run: |