File: ci.yml

package info (click to toggle)
mariadb-connector-python 1.1.14-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 952 kB
  • sloc: python: 6,288; ansic: 4,973; sh: 23; makefile: 14
file content (158 lines) | stat: -rw-r--r-- 6,820 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
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
---
name: Run CI Tests

on:
  push:
    branches: ['1.1', '1.0', 'sqlalchemy']
  pull_request:
  workflow_dispatch:
  schedule:
    # Run weekly on Sundays at 2 AM UTC
    - cron: '0 2 * * 0'

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: false

env:
  MYSQL_TEST_HOST: mariadb.example.com
  MYSQL_TEST_PORT: 3306
  MYSQL_TEST_USER: root
  MYSQL_TEST_PASSWD: "heyPassw-!*20oRd"
  MYSQL_TEST_DB: testp

jobs:

  setup:
    runs-on: ubuntu-latest
    if: |
      github.event_name != 'schedule' ||
      github.ref == 'refs/heads/3.4' ||
      github.ref == 'refs/heads/3.1' ||
      github.ref == 'refs/heads/3.2'
    outputs:
      matrix: ${{ steps.set-matrix.outputs.final-matrix }}
    steps:
      - uses: actions/checkout@v4
      - id: set-matrix
        name: build matrix
        uses: mariadb-corporation/connector-ci-build-matrix@main
        with:
          additional-matrix: '[{"name": "MariaDB 11.4", "os": "ubuntu-latest", "db-type": "community", "db-tag": "11.4", "python": "3.9"},{"name": "MariaDB 11.4", "os": "ubuntu-latest", "db-type": "community", "db-tag": "11.4", "python": "3.10"},{"name": "MariaDB 11.4", "os": "ubuntu-latest", "db-type": "community", "db-tag": "11.4", "python": "3.11"},{"name": "MariaDB 11.4", "os": "ubuntu-latest", "db-type": "community", "db-tag": "11.4", "python": "3.12"},{"name": "MariaDB 11.4", "os": "ubuntu-latest", "db-type": "community", "db-tag": "11.4", "python": "3.13"}, {"name": "MariaDB 11.4", "os": "ubuntu-latest", "db-type": "community", "db-tag": "11.4", "python": "3.14"}, {"name": "MariaDB 11.4", "os": "windows-latest", "db-type": "community", "db-tag": "11.4", "python": "3.14"}, {"name": "MariaDB 11.4", "os": "ubuntu-latest", "db-type": "community", "db-tag": "11.4", "python": "pypy3.11", "continue-on-error": true}]'

  ci:
    name: ${{ matrix.name }} ${{ matrix.python != '' && format(' - python {0}', matrix.python) || '' }}
    needs: setup
    timeout-minutes: 50
    strategy:
      matrix: ${{ fromJSON(needs.setup.outputs.matrix) }}

    runs-on: ${{ matrix.os }}
    continue-on-error: ${{ matrix.continue-on-error || false }}
    steps:
      - uses: actions/checkout@v4

      - name: Setup Test Environment
        id: setup-env
        uses: mariadb-corporation/connector-ci-setup@master
        with:
          node-version: ${{ matrix.node }}
          db-type: ${{ matrix.db-type }}
          db-tag: ${{ matrix.db-tag }}
          test-db-password: ${{ env.MYSQL_TEST_PASSWD }}
          test-db-database: ${{ env.MYSQL_TEST_DB }}
          test-db-port: ${{ env.MYSQL_TEST_PORT }}
          additional-conf: ${{ matrix.additional-conf || '' }}
          registry-user: ${{ matrix.db-type == 'enterprise' && secrets.ENTERPRISE_USER || (secrets.DOCKER_PWD != '' && 'mariadbtest' || '') }}
          registry-password: ${{ matrix.db-type == 'enterprise' && secrets.ENTERPRISE_TOKEN || secrets.DOCKER_PWD }}
          os: ${{ matrix.os }}
          init-script-folder: ${{ format('{0}/.github/workflows/init', github.workspace) }}

      - uses: actions/setup-python@v5
        id: setup-python
        with:
          python-version: ${{ matrix.python || '3.13' }}
          allow-prereleases: true

      - name: Clone C/C
        uses: GuillaumeFalourd/clone-github-repo-action@v2.3
        with:
          branch: '3.4'
          owner: 'mariadb-corporation'
          repository: 'mariadb-connector-c'

      - name: Clone SQLAlchemy
        if: ${{ startsWith(matrix.python, '3.13') }}
        uses: GuillaumeFalourd/clone-github-repo-action@v2.3
        with:
          branch: main
          owner: 'sqlalchemy'
          repository: 'sqlalchemy'

      - name: c/c make ubuntu
        if: ${{ startsWith(matrix.os, 'ubuntu') }}
        run: |
          cd ${{ github.workspace }}/mariadb-connector-c
          cmake . -DCMAKE_BUILD_TYPE=Release -DWITH_EXTERNAL_ZLIB=On -DCMAKE_INSTALL_PREFIX=/usr
          make -j4
          sudo make install
          echo "MARIADB_PLUGIN_DIR=`mariadb_config --plugindir`" >> $GITHUB_ENV
          echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/mariadb" >> $GITHUB_ENV

      - name: c/c make macos
        if: ${{ startsWith(matrix.os, 'mac') }}
        run: |
          cd ${{ github.workspace }}/mariadb-connector-c
          cmake . -DCMAKE_BUILD_TYPE=Release -DWITH_EXTERNAL_ZLIB=On
          make -j4
          sudo make install
          ls -lrt /usr/local/lib/mariadb/plugin
          echo "MARIADB_PLUGIN_DIR=`mariadb_config --plugindir`" >> $GITHUB_ENV
          echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/mariadb" >> $GITHUB_ENV
          echo "DYLD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib/mariadb:$DYLD_LIBRARY_PATH" >> $GITHUB_ENV
          echo "DYLD_FALLBACK_LIBRARY_PATH=/usr/local/lib:/usr/local/lib/mariadb" >> $GITHUB_ENV

      - name: c/c make windows
        if: ${{ startsWith(matrix.os, 'windows') }}
        shell: powershell
        run: |
          cd ${{ github.workspace }}/mariadb-connector-c
          $MARIADB_CC_INSTALL_DIR = "$env:USERPROFILE/conc"
          cmake . -DCMAKE_BUILD_TYPE=RelWithDebInfo -DWITH_CURL=ON -DCMAKE_INSTALL_PREFIX="$MARIADB_CC_INSTALL_DIR"
          cmake --build . --config RelWithDebInfo
          cmake --install . --config RelWithDebInfo
          echo "MARIADB_CC_INSTALL_DIR=$MARIADB_CC_INSTALL_DIR" >> $env:GITHUB_ENV
          echo "MARIADB_PLUGIN_DIR=$MARIADB_CC_INSTALL_DIR/lib/mariadb/plugin" >> $env:GITHUB_ENV

      - name: Run SQLAlchemy tests
        if: ${{ startsWith(matrix.python, '3.13') }}
        shell: bash
        run: |
          python --version
          python -m pip install .
          python -m pip install pytest typing_extensions
          cd ${{ github.workspace }}/sqlalchemy
          python -m pytest --dburi=mysql+mariadbconnector://$TEST_DB_USER:$TEST_DB_PASSWORD@$TEST_DB_HOST:$TEST_DB_PORT/$TEST_DB --backend-only
        env:
          TEST_DB_USER: ${{ env.MYSQL_TEST_USER }}
          TEST_DB_HOST: ${{ env.MYSQL_TEST_HOST }}
          TEST_DB_DATABASE: ${{ env.MYSQL_TEST_DB }}
          TEST_DB_PORT: ${{ env.MYSQL_TEST_PORT }}
          TEST_DB_PASSWORD: ${{ env.MYSQL_TEST_PASSWD }}
          TEST_DB: ${{ env.MYSQL_TEST_DB }}

      - name: Run test suite
        shell: bash
        run: |
          python --version
          python -m pip install .
          cd testing
          python -m unittest discover -v
        env:
          TEST_DB_USER: ${{ env.MYSQL_TEST_USER }}
          TEST_DB_HOST: ${{ env.MYSQL_TEST_HOST }}
          TEST_DB_DATABASE: ${{ env.MYSQL_TEST_DB }}
          TEST_DB_PORT: ${{ env.MYSQL_TEST_PORT }}
          TEST_DB_PASSWORD: ${{ env.MYSQL_TEST_PASSWD }}
          LOCAL_DB: ${{ steps.setup-env.outputs.database-type }}
          PYTHON_VERSION: ${{ steps.setup-python.outputs.python-version }}