diff --git a/.circleci/clickhouse.config.xml b/.circleci/clickhouse.config.xml deleted file mode 100644 index 18b4a69..0000000 --- a/.circleci/clickhouse.config.xml +++ /dev/null @@ -1,473 +0,0 @@ - - - - - - trace - /var/log/clickhouse-server/clickhouse-server.log - /var/log/clickhouse-server/clickhouse-server.err.log - 1000M - 10 - - - - 8123 - 9000 - - - 8443 - 9440 - - - - - - - /etc/clickhouse-server/server.crt - /etc/clickhouse-server/server.key - - /etc/clickhouse-server/dhparam.pem - none - true - true - sslv2,sslv3 - true - - - - true - true - sslv2,sslv3 - true - - - - RejectCertificateHandler - - - - - - - - - 9009 - - - - - - - - 0.0.0.0 - - - - - - - - - - - - 4096 - 3 - - - 100 - - - - - - 8589934592 - - - 5368709120 - - - - /var/lib/clickhouse/ - - - /var/lib/clickhouse/tmp/ - - - /var/lib/clickhouse/user_files/ - - - users.xml - - - default - - - - - - default - - - - - - - - - false - - - - - - - - localhost - 9000 - - - - - - - localhost - 9000 - - - - - localhost - 9000 - - - - - - - 127.0.0.1 - 9000 - - - - - 127.0.0.2 - 9000 - - - - - - - localhost - 9440 - 1 - - - - - - - localhost - 9000 - - - - - localhost - 1 - - - - - - - - - - - - - - - - - - 3600 - - - - 3600 - - - 60 - - - - - - - - - - system - query_log
- - toYYYYMM(event_date) - - 7500 -
- - - - system - trace_log
- - toYYYYMM(event_date) - 7500 -
- - - - system - query_thread_log
- toYYYYMM(event_date) - 7500 -
- - - - - - - - - - - - - - - - - - *_dictionary.xml - - - - - - - - - - /clickhouse/task_queue/ddl - - - - - - - - - - - - - - - - click_cost - any - - 0 - 3600 - - - 86400 - 60 - - - - max - - 0 - 60 - - - 3600 - 300 - - - 86400 - 3600 - - - - - - /var/lib/clickhouse/format_schemas/ - - - - - - -
\ No newline at end of file diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 00b7359..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,23 +0,0 @@ -version: 2 - -jobs: - bionic: - docker: - - image: vapor/swift:5.1-bionic - steps: - - checkout - - run: apt-key adv --keyserver keyserver.ubuntu.com --recv E0C56BD4; echo "deb http://repo.yandex.ru/clickhouse/deb/stable/ main/" | tee /etc/apt/sources.list.d/clickhouse.list - - run: apt-get update; DEBIAN_FRONTEND=noninteractive apt-get install -y clickhouse-server - - run: openssl req -subj "/CN=my.host.name" -days 365 -nodes -new -x509 -keyout /etc/clickhouse-server/server.key -out /etc/clickhouse-server/server.crt - - run: openssl dhparam -out /etc/clickhouse-server/dhparam.pem 1024 - - run: cat .circleci/clickhouse.config.xml > /etc/clickhouse-server/config.xml - - run: chown -R clickhouse:clickhouse /etc/clickhouse-server/ - - run: service clickhouse-server start - - run: swift build --enable-test-discovery - - run: CLICKHOUSE_SERVER="127.0.0.1" CLICKHOUSE_USER="default" CLICKHOUSE_PASSWORD="" swift test --enable-test-discovery - -workflows: - version: 2 - tests: - jobs: - - bionic \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..f2b367c --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,36 @@ +name: Release + +on: + workflow_dispatch: + +# Make sure to add .releaserc and select the right branch + +jobs: + release: + name: Release + runs-on: ubuntu-latest + environment: release + permissions: + contents: write + issues: write + pull-requests: write + id-token: write + packages: write + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + - name: Install semantic-release + run: | + npm install --no-save semantic-release conventional-changelog-conventionalcommits + - name: Release + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_ACTOR: ${{ github.actor }} + run: | + npx semantic-release diff --git a/.github/workflows/semantic-pr-check.yml b/.github/workflows/semantic-pr-check.yml new file mode 100644 index 0000000..e136678 --- /dev/null +++ b/.github/workflows/semantic-pr-check.yml @@ -0,0 +1,17 @@ +name: "Semantic PR Check" + +on: + pull_request_target: + types: + - opened + - edited + - synchronize + +jobs: + main: + name: Validate PR title + runs-on: ubuntu-latest + steps: + - uses: amannn/action-semantic-pull-request@v5.5.2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..1ecf032 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,60 @@ +# https://github.com/peripheryapp/periphery/blob/master/.github/workflows/test.yml + +name: Test +on: + push: + branches: + - main + pull_request: {} +env: + swift_package_resolve: swift package resolve + swift_build: swift build --build-tests + swift_test: CLICKHOUSE_USER="default" CLICKHOUSE_PASSWORD="" swift test + cache_version: 1 + CLICKHOUSE_SERVER: clickhouse +jobs: + linux: + strategy: + fail-fast: false + matrix: + swift: ["5.10", "5.9", "5.8"] + include: + - swift: "5.10" + container: "swift:5.10" + cache-version: 1 + - swift: "5.9" + container: "swift:5.9" + cache-version: 1 + - swift: "5.8" + container: "swift:5.8" + cache-version: 1 + runs-on: ubuntu-20.04 + container: ${{ matrix.container }} + name: Linux + services: + clickhouse: + image: clickhouse/clickhouse-server + steps: + - name: Get Swift Version + id: get-swift-version + run: | + echo "::set-output name=version::$(swift -version | head -n 1 | sed s/,// )" + shell: bash + - uses: actions/checkout@master + - name: Cache resolved dependencies + id: cache-resolved-dependencies + uses: actions/cache@v2 + with: + path: | + .build + Package.resolved + key: ${{ matrix.cache-version }}-${{ runner.os }}-${{ steps.get-swift-version.outputs.version }}-${{ env.cache_version }}-spm-deps-${{ hashFiles('Package.swift', 'Package.resolved') }} + restore-keys: | + ${{ matrix.cache-version }}-${{ runner.os }}-${{ steps.get-swift-version.outputs.version }}-${{ env.cache_version }}-spm-deps- + - name: Resolve dependencies + if: steps.cache-resolved-dependencies.outputs.cache-hit != 'true' + run: ${{ env.swift_package_resolve }} + - name: Build + run: ${{ env.swift_build }} + - name: Test + run: ${{ env.swift_test }} \ No newline at end of file diff --git a/.releaserc b/.releaserc new file mode 100644 index 0000000..3cb0e49 --- /dev/null +++ b/.releaserc @@ -0,0 +1,44 @@ +{ + "branches": [ + "main" + ], + "plugins": [ + [ + "@semantic-release/commit-analyzer", + { + "preset": "conventionalcommits", + "releaseRules": [ + { + "type": "build", + "scope": "deps", + "release": "patch" + } + ] + } + ], + [ + "@semantic-release/release-notes-generator", + { + "preset": "conventionalcommits", + "presetConfig": { + "types": [ + { + "type": "feat", + "section": "Features" + }, + { + "type": "fix", + "section": "Bug Fixes" + }, + { + "type": "build", + "section": "Dependencies and Other Build Updates", + "hidden": false + } + ] + } + } + ], + "@semantic-release/github" + ] +} \ No newline at end of file