From 2b718fbc21523239aa117136b77a3b254f0afe43 Mon Sep 17 00:00:00 2001 From: clowzed Date: Fri, 10 Nov 2023 23:08:02 +0300 Subject: [PATCH] Added test.yml for testing all pushes --- .github/workflows/tests.yml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..dad59d0 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,36 @@ + +name: Running Tests + +on: [push] + +jobs: + test: + runs-on: ubuntu-latest + + services: + postgres: + image: postgres + + env: + POSTGRES_PASSWORD: postgres + POSTGRES_USER: postgres + POSTGRES_DB: postgres + + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + ports: + - 5432:5432 + + steps: + - uses: actions/checkout@v2 + - name: Build + run: cargo build --verbose + - name: Run tests + run: cargo test --verbose + env: + DATABASE_URL: "postgres://postgres:postgres@localhost:5432/postgres" + PORT: 8080 +