Bin
2025-12-17 21f0498f62ada55651f4d232327e15fc47f498b1
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
name: "Tests"
 
on:
  workflow_call:
    inputs:
      head_sha:
        required: true
        type: string
 
env:
  DJANGO_SETTINGS_MODULE: core.settings.label_studio
  COVERAGE_PROCESS_START: 1
  LOG_DIR: pytest_logs
  COLLECT_ANALYTICS: true
  DEBUG_CONTEXTLOG: true
  LABEL_STUDIO_TEST_ENVIRONMENT: false
  SENTRY_RATE: 0
  JSON_LOG: 0
  POETRY_VERSION: 2.1.4
 
jobs:
  sqlite-migrations:
    name: "sqlite-migrations"
    runs-on: ubuntu-latest
    timeout-minutes: 20
    env:
      DJANGO_DB: sqlite
      SENTRY_ENVIRONMENT: tests-ubuntu-sqlite
 
    steps:
      - uses: hmarr/debug-action@v3.0.0
 
      - name: "Checkout"
        uses: actions/checkout@v6
        with:
          ref: ${{ inputs.ref }}
 
      - name: "Install poetry"
        run: pipx install "poetry==${{ env.POETRY_VERSION }}"
 
      - name: "Set up Python"
        id: setup_python
        uses: actions/setup-python@v6
        with:
          python-version: '3.13'
          cache: 'poetry'
 
      - name: "Install OS dependencies"
        run: |
          sudo apt-get update
          sudo apt-get install libsasl2-dev python3-dev libldap2-dev libssl-dev libxml2-dev libxslt-dev
 
      - name: "Install dependencies"
        run: poetry install
 
      - name: "Test migrations"
        run: |
          output=$(poetry run python label_studio/manage.py makemigrations)
          if ! grep 'No changes detected' <<< "${output}"; then
            error="${output}"
            error="${error//'%'/'%25'}"
            error="${error//$'\n'/'%0A'}"
            error="${error//$'\r'/'%0D'}"
            echo "::error::${error}"
            exit 1
          fi
 
  pgsql-migrations:
    name: "pgsql-migrations"
    runs-on: ubuntu-latest
    timeout-minutes: 20
    env:
      SENTRY_ENVIRONMENT: tests-ubuntu-pgsql
      DJANGO_DB: default
      CI: true
 
    services:
      postgres:
        image: postgres:13.8
        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: hmarr/debug-action@v3.0.0
 
      - name: "Checkout"
        uses: actions/checkout@v6
        with:
          ref: ${{ inputs.ref }}
          fetch-depth: 2147483647
 
      - name: "Install poetry"
        run: pipx install "poetry==${{ env.POETRY_VERSION }}"
 
      - name: "Set up Python"
        id: setup_python
        uses: actions/setup-python@v6
        with:
          python-version: '3.13'
          cache: 'poetry'
 
      - name: "Install OS dependencies"
        run: |
          sudo apt-get update
          sudo apt-get install libsasl2-dev python3-dev libldap2-dev libssl-dev libxml2-dev libxslt-dev
 
      - name: "Install dependencies"
        run: |
          poetry install
 
      - name: "Test migrations"
        run: |
          poetry run python label_studio/manage.py makemigrations
 
      - name: "Lint migrations"
        run: |
          poetry run python label_studio/manage.py lintmigrations --warnings-as-errors --project-root-path '.' --git-commit-id ${{ github.event.pull_request.base.sha || github.event.before }}