Unit tests #730
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Unit tests | |
| permissions: read-all | |
| on: | |
| push: | |
| branches: | |
| - master | |
| tags: | |
| - "**" | |
| schedule: | |
| - cron: "0 0 * * SUN" | |
| pull_request: | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-22.04 | |
| strategy: | |
| matrix: | |
| python-version: ["3.12"] | |
| env: | |
| MYSQL_VERSION: mysql-8.0 | |
| steps: | |
| - id: checkout-code | |
| uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: false | |
| - id: prepare-python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-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.jammy" | |
| python-version: "3.10" | |
| ubuntu-version: "22.04" | |
| - mysql-version: "8.0.32" | |
| percona-version: "8.0.32-26-1.jammy" | |
| python-version: "3.11" | |
| ubuntu-version: "22.04" | |
| - mysql-version: "8.0.35" | |
| percona-version: "8.0.35-30-1.jammy" | |
| python-version: "3.11" | |
| ubuntu-version: "22.04" | |
| - mysql-version: "8.0.35" | |
| percona-version: "8.0.35-30-1.jammy" | |
| python-version: "3.12" | |
| ubuntu-version: "22.04" | |
| steps: | |
| - id: checkout-code | |
| uses: actions/checkout@v4 | |
| - name: Cache APT Packages | |
| uses: awalsh128/cache-apt-pkgs-action@v1.1.2 | |
| with: | |
| version: 1.0 | |
| packages: sudo lsb-release wget tzdata 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 |