From c262df6a825ce87f0675c946e25c1d5c253cbb55 Mon Sep 17 00:00:00 2001 From: sw <935405794@qq.com> Date: Fri, 3 Jun 2022 15:20:57 +0800 Subject: [PATCH] ci --- .github/workflows/ci.yml | 64 ++++++++++++++++++++++++++++++++++ .github/workflows/unittest.yml | 42 ---------------------- README.md | 2 ++ 3 files changed, 66 insertions(+), 42 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/unittest.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..fcd2e0e --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,64 @@ +name: ci + +on: + push: + # Publish `master` as Docker `latest` image. + branches: + - master + - develop + + # Publish `v1.2.3` tags as releases. + tags: + - v* + + # Run tests for any PRs. + pull_request: + +env: + IMAGE_NAME: ch_orm + +jobs: + # Run tests. + # See also https://docs.docker.com/docker-hub/builds/automated-testing/ + test: + runs-on: ubuntu-latest + services: + clickhouse: + image: clickhouse/clickhouse-server + ports: + - 8123:8123 + - 9000:9000 + options: --ulimit nofile=262144:262144 + strategy: + matrix: + python-version: [ "3.7", "3.8", "3.9", "3.10" ] + steps: + - uses: actions/checkout@v2 + - name: Build and Install + run: | + pip install build + python -m build + pip install dist/* + pip install coverage + - name: UnitTest + run: | + coverage run --source=clickhouse_orm -m unittest + - name: Upload Coverage + run: coveralls --service=github + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + COVERALLS_FLAG_NAME: ${{ matrix.python-version }} + COVERALLS_PARALLEL: true + + coveralls: + name: Finish Coveralls + needs: test + runs-on: ubuntu-latest + container: python:3-slim + steps: + - name: Finished + run: | + pip3 install --upgrade coveralls + coveralls --finish + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/unittest.yml b/.github/workflows/unittest.yml deleted file mode 100644 index d0cf682..0000000 --- a/.github/workflows/unittest.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: Docker - -on: - push: - # Publish `master` as Docker `latest` image. - branches: - - master - - develop - - # Publish `v1.2.3` tags as releases. - tags: - - v* - - # Run tests for any PRs. - pull_request: - -env: - IMAGE_NAME: ch_orm - -jobs: - # Run tests. - # See also https://docs.docker.com/docker-hub/builds/automated-testing/ - test: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - - name: Pull images - run: | - docker pull clickhouse/clickhouse-server - docker run -d --network=host --name some-clickhouse-server --ulimit nofile=262144:262144 clickhouse/clickhouse-server - - - name: Build and Install - run: | - pip install build - python -m build - pip install dist/* - - - name: UnitTest - run: | - python -m unittest diff --git a/README.md b/README.md index 30f3227..f9e7335 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ A fork of [infi.clikchouse_orm](https://github.com/Infinidat/infi.clickhouse_orm This repository expects to use more type hints, and will drop support for Python 2.x. +[![Coverage Status](https://coveralls.io/repos/github/sswest/ch-orm/badge.svg?branch=develop)](https://coveralls.io/github/sswest/ch-orm?branch=develop) + Introduction ============