File: test.yaml

package info (click to toggle)
python-pymysql 1.1.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 836 kB
  • sloc: python: 6,473; makefile: 134; sh: 44; sql: 10
file content (116 lines) | stat: -rw-r--r-- 3,407 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
name: Test

on:
  push:
  pull_request:

concurrency:
  group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
  cancel-in-progress: true

env:
  FORCE_COLOR: 1

jobs:
  test:
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        include:
          - db: "mariadb:12"  # rolling release
            py: "3.13"
            # pynacl 1.5 doesn't support Python 3.14 yet.
            # https://github.com/pyca/pynacl/commit/d33028e43b814615a33e231925eaddb0f679fa2b

          - db: "mariadb:11.8"
            py: "3.12"

          - db: "mariadb:11.4"
            py: "3.11"

          - db: "mariadb:10.11"
            py: "3.10"

          - db: "mariadb:10.6"
            py: "3.9"

          - db: "mysql:8.0"
            py: "pypy3.11"
            mysql_auth: true

          - db: "mysql:9"
            py: "3.14"
            mysql_auth: true

          - db: "mysql:8.4"
            py: "3.9"
            mysql_auth: true

          - db: "mysql:5.7"
            py: "3.9"

    services:
      mysql:
        image: "${{ matrix.db }}"
        ports:
          - 3306:3306
        env:
          MYSQL_ALLOW_EMPTY_PASSWORD: yes
          MARIADB_ALLOW_EMPTY_ROOT_PASSWORD: yes
        options: "--name=mysqld"
        volumes:
          - /run/mysqld:/run/mysqld

    steps:
      - uses: actions/checkout@v5

      - name: Workaround MySQL container permissions
        if: startsWith(matrix.db, 'mysql')
        run: |
          sudo chown 999:999 /run/mysqld
          /usr/bin/docker ps --all --filter status=exited --no-trunc --format "{{.ID}}" | xargs -r /usr/bin/docker start

      - name: Set up Python ${{ matrix.py }}
        uses: actions/setup-python@v5
        with:
          python-version: ${{ matrix.py }}
          allow-prereleases: true
          cache: 'pip'
          cache-dependency-path: 'requirements-dev.txt'

      - name: Install dependency
        run: |
          pip install --upgrade -r requirements-dev.txt

      - name: Set up MySQL
        run: |
          while :
          do
              sleep 1
              mysql -h127.0.0.1 -uroot -e 'select version()' && break
          done
          mysql -h127.0.0.1 -uroot -e "SET GLOBAL local_infile=on"
          mysql -h127.0.0.1 -uroot --comments < ci/docker-entrypoint-initdb.d/init.sql
          mysql -h127.0.0.1 -uroot --comments < ci/docker-entrypoint-initdb.d/mysql.sql
          mysql -h127.0.0.1 -uroot --comments < ci/docker-entrypoint-initdb.d/mariadb.sql
          cp ci/docker.json pymysql/tests/databases.json

      - name: Run test
        run: |
          pytest -v --cov --cov-config .coveragerc pymysql
          pytest -v --cov-append --cov-config .coveragerc --doctest-modules pymysql/converters.py

      - name: Run MySQL8 auth test
        if: ${{ matrix.mysql_auth }}
        run: |
          docker cp mysqld:/var/lib/mysql/public_key.pem "${HOME}"
          docker cp mysqld:/var/lib/mysql/ca.pem "${HOME}"
          docker cp mysqld:/var/lib/mysql/server-cert.pem "${HOME}"
          docker cp mysqld:/var/lib/mysql/client-key.pem "${HOME}"
          docker cp mysqld:/var/lib/mysql/client-cert.pem "${HOME}"
          pytest -v --cov-append --cov-config .coveragerc tests/test_auth.py;

      - name: Upload coverage reports to Codecov
        if: github.repository == 'PyMySQL/PyMySQL'
        uses: codecov/codecov-action@v5