File: test.yaml

package info (click to toggle)
python-sqlalchemy-utils 0.41.2-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 1,252 kB
  • sloc: python: 13,566; makefile: 141
file content (75 lines) | stat: -rw-r--r-- 2,393 bytes parent folder | download | duplicates (2)
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
name: Tests
on: [push, pull_request]
jobs:
  test:
    strategy:
      fail-fast: false
      matrix:
        os: ['ubuntu-latest']
        python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
        tox_env: ['sqlalchemy14', 'sqlalchemy2']
        include:
          # Test against Python 3.7 and sqlalchemy 1.3
          - os: 'ubuntu-20.04'
            python-version: '3.7'
            tox_env: 'sqlalchemy13'
          # Test against Python 3.7 and sqlalchemy 1.4
          - os: 'ubuntu-20.04'
            python-version: '3.7'
            tox_env: 'sqlalchemy14'
    runs-on: ${{ matrix.os }}
    services:
      postgres:
        image: postgres:latest
        env:
          POSTGRES_USER: postgres
          POSTGRES_PASSWORD: postgres
          POSTGRES_DB: sqlalchemy_utils_test
        # Set health checks to wait until PostgreSQL has started
        options: >-
          --health-cmd pg_isready
          --health-interval 10s
          --health-timeout 5s
          --health-retries 5
        ports:
          - 5432:5432
      mysql:
        image: mysql:latest
        env:
          MYSQL_ALLOW_EMPTY_PASSWORD: yes
          MYSQL_DATABASE: sqlalchemy_utils_test
        ports:
          - 3306:3306
      mssql:
        image: mcr.microsoft.com/mssql/server:2017-latest
        env:
          ACCEPT_EULA: Y
          SA_PASSWORD: Strong_Passw0rd
        # Set health checks to wait until SQL Server has started
        options: >-
          --health-cmd "/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P ${SA_PASSWORD} -Q 'SELECT 1;' -b"
          --health-interval 10s
          --health-timeout 5s
          --health-retries 5
        ports:
          - 1433:1433
    steps:
      - uses: actions/checkout@v3
      - name: Set up Python
        uses: actions/setup-python@v4
        with:
          python-version: ${{ matrix.python-version }}
      - name: Install MS SQL stuff
        run: bash .ci/install_mssql.sh
      - name: Add hstore extension to the sqlalchemy_utils_test database
        env:
          PGHOST: localhost
          PGPASSWORD: postgres
          PGPORT: 5432
        run: psql -U postgres -d sqlalchemy_utils_test -c 'CREATE EXTENSION hstore;'
      - name: Install tox
        run: pip install tox
      - name: Run tests
        env:
          SQLALCHEMY_UTILS_TEST_POSTGRESQL_PASSWORD: postgres
        run: tox -e ${{ matrix.tox_env }}