-
Notifications
You must be signed in to change notification settings - Fork 20
135 lines (120 loc) · 4.44 KB
/
tests.yaml
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
name: Unit tests
permissions: read-all
on:
push:
branches:
- master
tags:
- "**"
schedule:
- cron: "0 0 * * SUN"
pull_request:
jobs:
lint:
runs-on: ubuntu-20.04
strategy:
matrix:
# only use one version for the lint step
# pylint is broken with 3.11, see
# https://github.com/PyCQA/pylint/issues/6535
python-version: ["3.10"]
env:
MYSQL_VERSION: mysql-8.0
steps:
- id: checkout-code
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Cache APT Packages
uses: awalsh128/[email protected]
with:
version: 1.0
packages: sudo lsb-release wget tzdata libsnappy-dev libpq5 libpq-dev software-properties-common build-essential rsync curl
- id: prepare-python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- id: mysql-repos
run: |
wget -c 'https://repo.mysql.com/mysql-apt-config_0.8.22-1_all.deb'
echo "mysql-apt-config mysql-apt-config/select-server select $MYSQL_VERSION" | sudo debconf-set-selections
echo "mysql-apt-config mysql-apt-config/select-tools select Enabled" | sudo debconf-set-selections
echo "mysql-apt-config mysql-apt-config/select-product select Ok" | sudo debconf-set-selections
echo "mysql-apt-config mysql-apt-config/tools-component string mysql-tools" | sudo debconf-set-selections
sudo dpkg -i mysql-apt-config_0.8.22-1_all.deb
- id: percona-tools
run: |
wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb
sudo dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb
sudo percona-release enable-only tools
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys B7B3B788A8D3785C
sudo apt update
- id: build-deps
run: |
sudo apt-get update
sudo apt install -y libsnappy-dev
sudo apt-get install -q -y --allow-unauthenticated -o Dpkg::Options::=--force-confnew mysql-server percona-xtrabackup-80
mysqld --version
- id: python-deps
run: |
pip install -e .
pip install -e '.[dev]'
- id: pre-commit
run: pre-commit run --all
- id: copyright
run: make copyright
unittest:
runs-on: ubuntu-${{ matrix.ubuntu-version }}
strategy:
fail-fast: false
# this isn't a standard matrix because some version testing doesn't make sense
# e.g. you cannot use mysql .28 with percona .27, and there's no clean way of
# skipping matrix items that aren't meaningful
matrix:
include:
- mysql-version: "8.0.32"
percona-version: "8.0.32-26-1.focal"
python-version: "3.9"
ubuntu-version: "20.04"
- mysql-version: "8.0.32"
percona-version: "8.0.32-26-1.focal"
python-version: "3.10"
ubuntu-version: "20.04"
- mysql-version: "8.0.32"
percona-version: "8.0.32-26-1.focal"
python-version: "3.11"
ubuntu-version: "20.04"
- mysql-version: "8.0.35"
percona-version: "8.0.35-30-1.focal"
python-version: "3.11"
ubuntu-version: "20.04"
steps:
- id: checkout-code
uses: actions/checkout@v4
- name: Cache APT Packages
uses: awalsh128/[email protected]
with:
version: 1.0
packages: sudo lsb-release wget tzdata libsnappy-dev libpq5 libpq-dev software-properties-common build-essential rsync curl git libaio1 libmecab2 psmisc
- id: prepare-python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: |
**/requirements.txt
**/requirements.dev.txt
- run: make clean
- run: sudo scripts/remove-default-mysql
- run: sudo scripts/install-mysql-packages ${{matrix.mysql-version}}
- run: sudo scripts/setup-percona-repo
- run: sudo scripts/install-percona-package ${{matrix.percona-version}}
- run: scripts/install-python-deps
- run: python -m pip install -e .
- id: unittest
run: |
make coverage
- id: upload-codecov
uses: codecov/codecov-action@v3
with:
verbose: true