From 8bc266287c497cf6b939c6b4b42001ca1b4e491d Mon Sep 17 00:00:00 2001 From: grillazz Date: Tue, 27 Apr 2021 15:58:33 +0200 Subject: [PATCH] add ci --- .github/workflows/build-and-test.yml | 45 ++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/build-and-test.yml diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml new file mode 100644 index 0000000..055c603 --- /dev/null +++ b/.github/workflows/build-and-test.yml @@ -0,0 +1,45 @@ + +name: Unit Tests + +on: + push: + branches: + - main + pull_request: + branches: + - main +jobs: + build: + runs-on: ubuntu-latest + + services: + sqldb: + image: postgres:13 + env: + POSTGRES_USER: user + ports: + - 5432:5432 + # needed because the postgres container does not provide a healthcheck + options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 + + steps: + - uses: actions/checkout@v1 + - name: Set up Python 3.9 + uses: actions/setup-python@v1 + with: + python-version: 3.9 + - name: Install pipenv + run: pip install pipenv + - name: Install required libs + run: pipenv install --system --sequential --ignore-pipfile --dev + - name: Run tests + run: pytest + env: + PYTHONDONTWRITEBYTECODE: 1 + PYTHONUNBUFFERED: 1 + SQL_DB: devdb + SQL_TEST_DB: testdb + SQL_HOST: db + SQL_USER: user + SQL_PASS: secret +