Repository: kraken-tech/django-integrity (language: python)

Issue:
Run tests in CI



Discussion / hints:

Fix patch:
diff --git a/.github/workflows/checks.yaml b/.github/workflows/checks.yaml
new file mode 100644
index 0000000..a31eed4
--- /dev/null
+++ b/.github/workflows/checks.yaml
@@ -0,0 +1,31 @@
+name: Linting
+
+on:
+  pull_request:
+  push:
+    branches:
+      - main
+
+jobs:
+  build:
+    runs-on: ubuntu-22.04
+    timeout-minutes: 3
+
+    strategy:
+      matrix:
+        python-version: ["3.10"]
+
+    steps:
+      - name: Clone the code
+        uses: actions/checkout@v4
+
+      - name: Set up Python ${{ matrix.python-version }}
+        uses: actions/setup-python@v5
+        with:
+          python-version: ${{ matrix.python-version }}
+
+      - name: Install requirements
+        run: make install
+
+      - name: Run linters
+        run: make lint
diff --git a/tox.ini b/tox.ini
index dd3c76d..8935309 100644
--- a/tox.ini
+++ b/tox.ini
@@ -6,6 +6,8 @@ env_list =
     py310-django{41,42,50}
 
 [testenv]
+pass_env =
+    DATABASE_URL
 deps =
     -r requirements/development.txt
     psycopg2-binary


Test patch:
diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml
new file mode 100644
index 0000000..52a0e5e
--- /dev/null
+++ b/.github/workflows/tests.yaml
@@ -0,0 +1,46 @@
+name: Python tests
+
+on:
+  pull_request:
+  push:
+    branches:
+      - main
+
+jobs:
+  build:
+    runs-on: ubuntu-22.04
+    timeout-minutes: 5
+
+    services:
+      postgres:
+        image: postgres
+        env:
+          POSTGRES_PASSWORD: postgres
+        options: >-
+          --health-cmd pg_isready
+          --health-interval 10s
+          --health-timeout 5s
+          --health-retries 5
+        ports:
+          - 5432:5432
+
+    strategy:
+      matrix:
+        python-version: ["3.10", "3.11", "3.12"]
+
+    steps:
+      - name: Clone the code
+        uses: actions/checkout@v4
+
+      - name: Set up Python ${{ matrix.python-version }}
+        uses: actions/setup-python@v5
+        with:
+          python-version: ${{ matrix.python-version }}
+
+      - name: Install requirements
+        run: make install
+
+      - name: Run the tests
+        run: tox
+        env:
+          DATABASE_URL: postgres://postgres:postgres@localhost/django_integrity