Skip to content

Commit

Permalink
[rev: 1]
Browse files Browse the repository at this point in the history
  • Loading branch information
aalexfvk committed Aug 11, 2023
1 parent ea4e542 commit 444bb42
Show file tree
Hide file tree
Showing 11 changed files with 156 additions and 140 deletions.
4 changes: 0 additions & 4 deletions .github/actions/setup_dependencies/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ description: Create Python environment with all dependencies installed
inputs:
python-version:
required: true
poetry-version:
required: true
runs:
using: "composite"
steps:
Expand All @@ -28,8 +26,6 @@ runs:

- name: Install Python dependencies
shell: bash
env:
POETRY_VERSION: ${{ inputs.poetry-version }}
run: |
sudo make install-poetry
make install-deps
41 changes: 18 additions & 23 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ concurrency:
env:
BUILD_DEB_OUTPUT_DIR: out
BUILD_PYTHON_OUTPUT_DIR: dist
# The latest version supporting Python 3.6
POETRY_VERSION: 1.1.15

PROJECT_NAME: clickhouse-tools
PROJECT_NAME_UNDESCORE: clickhouse_tools

jobs:
lint:
Expand All @@ -22,8 +21,7 @@ jobs:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup_dependencies
with:
python-version: "3.10.12"
poetry-version: ${{ env.POETRY_VERSION }}
python-version: "3.10"
- name: "lint: isort"
run: make isort
- name: "lint: black"
Expand All @@ -44,8 +42,8 @@ jobs:
fail-fast: false
matrix:
target:
- { python: "3.6.15", ubuntu: "20.04" }
- { python: "3.10.12", ubuntu: "latest" }
- { python: "3.6", ubuntu: "20.04" }
- { python: "3.10", ubuntu: "latest" }
clickhouse:
- "21.8.15.7"
- "22.3.20.29"
Expand All @@ -59,10 +57,9 @@ jobs:
- uses: ./.github/actions/setup_dependencies
with:
python-version: ${{ matrix.target.python }}
poetry-version: ${{ env.POETRY_VERSION }}

- run: make unit-tests
- run: make integration-tests
- run: make test-unit
- run: make test-integration

- name: publish test report
uses: mikepenz/action-junit-report@v3
Expand Down Expand Up @@ -90,15 +87,14 @@ jobs:
push: true


build:
release:
needs: tests
strategy:
fail-fast: false
matrix:
target:
- {python: "3.6.15", ubuntu: "20.04"}
- {python: "3.10.12", ubuntu: "latest"}
# a copy-paste of the above as github CI can't use env context in matrices
- {python: "3.6", ubuntu: "20.04"}
- {python: "3.10", ubuntu: "latest"}

runs-on: ubuntu-${{ matrix.target.ubuntu }}
steps:
Expand All @@ -107,22 +103,21 @@ jobs:
- uses: ./.github/actions/setup_dependencies
with:
python-version: ${{ matrix.target.python }}
poetry-version: ${{ env.POETRY_VERSION }}

- name: build project
run: make build-python-packages

- name: upload wheel
uses: actions/upload-artifact@v3
with:
name: ch_tools_py${{ matrix.target.python }}.whl
name: ${{ env.PROJECT_NAME_UNDESCORE }}_py${{ matrix.target.python }}.whl
path: ${{ env.BUILD_PYTHON_OUTPUT_DIR }}/*.whl
if-no-files-found: error

- name: upload sdist
uses: actions/upload-artifact@v3
with:
name: ch_tools_py${{ matrix.target.python }}.tar.gz
name: ${{ env.PROJECT_NAME_UNDESCORE }}_py${{ matrix.target.python }}.tar.gz
path: ${{ env.BUILD_PYTHON_OUTPUT_DIR }}/*.tar.gz
if-no-files-found: error

Expand All @@ -133,12 +128,12 @@ jobs:
run: |
# Speedup Debian package building
echo "force-unsafe-io" | sudo tee /etc/dpkg/dpkg.cfg.d/force-unsafe-io
sudo make build-deb-package
make build-deb-package
- name: test DEB package
run: |
sudo make uninstall
sudo apt-get install -q -y ./${{ env.BUILD_DEB_OUTPUT_DIR }}/ch-tools*.deb
sudo apt-get install -q -y ./${{ env.BUILD_DEB_OUTPUT_DIR }}/*.deb
sudo chadmin --help
sudo ch-monitoring --no-user-check --help
sudo keeper-monitoring --help
Expand All @@ -147,8 +142,8 @@ jobs:
- name: upload DEB package artifact
uses: actions/upload-artifact@v3
with:
name: ch-tools_py-${{ matrix.target.python }}_ubuntu-${{ matrix.target.ubuntu }}.deb
path: ${{ env.BUILD_DEB_OUTPUT_DIR }}/ch-tools*.deb
name: ${{ env.PROJECT_NAME }}_py-${{ matrix.target.python }}_ubuntu-${{ matrix.target.ubuntu }}.deb
path: ${{ env.BUILD_DEB_OUTPUT_DIR }}/*.deb
if-no-files-found: error

- name: create a release
Expand All @@ -160,7 +155,7 @@ jobs:
files: |
${{ env.BUILD_PYTHON_OUTPUT_DIR }}/*.whl
${{ env.BUILD_PYTHON_OUTPUT_DIR }}/*.tar.gz
${{ env.BUILD_DEB_OUTPUT_DIR }}/ch-tools*.deb
${{ env.BUILD_DEB_OUTPUT_DIR }}/*.deb
- name: publish to PYPI
if: ${{ matrix.target.ubuntu == 'latest' && startsWith(github.ref, 'refs/tags/') }}
Expand All @@ -169,5 +164,5 @@ jobs:
env:
POETRY_HTTP_BASIC_PYPI_USERNAME: "__token__"
POETRY_HTTP_BASIC_PYPI_PASSWORD: "${{ secrets.PYPI_TOKEN }}"
# Disable using keyring for poetry to get password from env variables
# Disable using keyring for poetry to get password from env variable
PYTHON_KEYRING_BACKEND: keyring.backends.null.Keyring
2 changes: 1 addition & 1 deletion AUTHORS
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
The following authors have created the source code of "ch-tools"
The following authors have created the source code of "clickhouse-tools"
published and distributed by YANDEX LLC as the owner:

Alexander Burmak <[email protected]>
Expand Down
Loading

0 comments on commit 444bb42

Please sign in to comment.