File: ci-tests.yml

package info (click to toggle)
python-django-timescaledb 0.2.13-4
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 304 kB
  • sloc: python: 512; sh: 20; makefile: 6; sql: 4
file content (48 lines) | stat: -rw-r--r-- 1,197 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: Django timescaledb - Test basic project setup
on:
  push:
    branches: [main]

jobs:
  setup-example-project:
    runs-on: ubuntu-latest
    env:
      DB_NAME: test
      DB_USER: postgres
      DB_PORT: 5433

    steps:
      - uses: actions/checkout@v1
      - name: Set up Python 3.7
        uses: actions/setup-python@v1
        with:
          python-version: 3.7

      - name: Checkout code
        uses: actions/checkout@v2

      - name: Install dependencies
        run: |-
          cd example
          pip install -r requirements.txt

          # Start timescaledb
          docker run -d --name timescaledb -p 5433:5432 -e POSTGRES_PASSWORD=password -e POSTGRES_DB=test timescale/timescaledb:2.5.1-pg14

          # Wait for db to be ready
          sleep 4

          # Migrate
          PYTHONPATH=../ python3 manage.py migrate

      - name: Run tests
        run: |-
          cd example
          PYTHONPATH=../ python3 manage.py test

      - name: Test alter field
        run: |-
          cd example
          sed -i -e 's/1 day/2 days/g' metrics/models.py
          PYTHONPATH=../ python3 manage.py makemigrations
          PYTHONPATH=../ python3 manage.py migrate