Use custom built-in python with ch-backup #523
This file contains 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: main | |
on: | |
push: { branches: [main] } | |
pull_request: { branches: [main] } | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.run_number }} | |
cancel-in-progress: true | |
env: | |
NO_VENV: true | |
LATEST_CLICKHOUSE_VERSION: latest | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
cache: pip | |
- name: "lint: isort" | |
run: make isort | |
- name: "lint: black" | |
run: make black | |
- name: "lint: codespell" | |
run: make codespell | |
- name: "lint: ruff" | |
run: make ruff | |
- name: "lint: pylint" | |
run: make pylint | |
- name: "lint: mypy" | |
run: make mypy | |
- name: "lint: bandit" | |
run: make bandit | |
test: | |
name: test (Python ${{ matrix.python }}, ClickHouse ${{ matrix.clickhouse }}) | |
needs: lint | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- python: "3.6" | |
clickhouse: "latest" | |
- python: "3.7" | |
clickhouse: "latest" | |
- python: "3.8" | |
clickhouse: "latest" | |
- python: "3.9" | |
clickhouse: "latest" | |
- python: "3.10" | |
clickhouse: "22.8.21.38" | |
- python: "3.10" | |
clickhouse: "23.3.22.3" | |
- python: "3.10" | |
clickhouse: "23.8.13.25" | |
- python: "3.10" | |
clickhouse: "24.3.2.23" | |
- python: "3.10" | |
clickhouse: "latest" | |
- python: "3.11" | |
clickhouse: "latest" | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: set up python ${{ matrix.python }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: run unit tests | |
run: make test-unit | |
- name: run integration tests | |
run: make test-integration | |
env: | |
CLICKHOUSE_VERSION: ${{ matrix.clickhouse == 'latest' && env.LATEST_CLICKHOUSE_VERSION || matrix.clickhouse }} | |
- uses: actions/upload-artifact@v4 | |
if: ${{ failure() }} | |
with: | |
name: integration-test-logs-py${{ matrix.python }}-clickhouse-${{ matrix.clickhouse }} | |
path: staging/logs/ | |
if-no-files-found: ignore | |
test_build_with_python: | |
name: test build with custom python version | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
arch: ["amd64"] | |
distro: ["bionic"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build with custom python | |
shell: bash | |
env: | |
PYTHON_BUILD_NAME: ${{ matrix.distro }}-python-${{ matrix.arch }} | |
TARGET_PYTHON_VERSION: 3.12.3 | |
DEB_TARGET_PLATFORM: linux/${{ matrix.arch }} | |
DEB_BUILD_DISTRIBUTION: ubuntu:${{ matrix.distro }} | |
DOCKER_BUILDKIT: 1 | |
run: | | |
make build-python |