11name : Tests (PyPA packages)
22
3- on :
4- push :
5- branches :
6- - " master"
7- pull_request :
8- branches :
9- - " master"
3+ on : [workflow_call]
104
115jobs :
126 test :
@@ -25,18 +19,16 @@ jobs:
2519 os : " ubuntu-22.04"
2620 - python-version : " 3.7"
2721 os : " ubuntu-22.04"
28- - python-version : " 3.6"
29- os : " ubuntu-20.04"
30- - python-version : " 3.5"
31- os : " ubuntu-20.04"
3222
3323 runs-on : ${{ matrix.os }}
3424 env :
35- GET_PIP_PATH_PREFIX : ${{ contains(fromJSON('["3.7", "3.6", "3.5 "]'), matrix.python-version) && format('pip/{0}/', matrix.python-version) || '' }}
25+ GET_PIP_PATH_PREFIX : ${{ contains(fromJSON('["3.7", "3.8 "]'), matrix.python-version) && format('pip/{0}/', matrix.python-version) || '' }}
3626 steps :
3727 - uses : actions/checkout@v3
3828 with :
3929 submodules : ' true'
30+ - name : Set up Redis server
31+ run : sudo apt-get install redis
4032 - name : Include ppa repository
4133 run : sudo add-apt-repository ppa:deadsnakes/ppa
4234
4739 sudo update-alternatives --install /usr/bin/python3-config python3-config `which python${{ matrix.python-version }}-config` 1
4840
4941 - name : Install disutils package
50- if : contains(fromJSON('["3.5" ]'), matrix.python-version) == false
42+ if : contains(fromJSON('["3.7", "3.8", "3.9", "3.10", "3.11" ]'), matrix.python-version)
5143 run : sudo apt-get install python${{ matrix.python-version }}-distutils
5244
5345 - name : Download get-pip.py
@@ -56,16 +48,26 @@ jobs:
5648 - name : Install pip
5749 run : python3 get-pip.py
5850
59- # TODO: try to remove this after unpining redis
60- - name : Install setuptools
61- if : contains(fromJSON('["3.12"]'), matrix.python-version)
62- run : python3 get-pip.py "setuptools"
63-
6451 - name : Install requirements
6552 run : python3 -m pip install -r requirements.txt
6653
54+ - name : Create symlinks for testing
55+ run : |
56+ ln -s tests/_minqlx.py
57+ ln -s tests/minqlx_plugin_test
58+ ln -s tests/minqlx-repo/python/minqlx
59+
6760 - name : Install requirements for testing
68- run : python3 -m pip install mockito
61+ run : python3 -m pip install mockito coverage
6962
7063 - name : Run tests
71- run : python3 -m unittest tests
64+ run : coverage run -m unittest tests
65+
66+ - name : Make coverage report
67+ run : coverage xml
68+
69+ - name : Upload coverage report as artifact
70+ uses : actions/upload-artifact@v4
71+ with :
72+ name : coverage - pypa - ubuntu - ${{ matrix.python-version }}.xml
73+ path : coverage.xml
0 commit comments