Merge pull request #2 from drivly/changeset-release/main #28
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: CI | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
services: | |
clickhouse: | |
image: clickhouse/clickhouse-server:latest | |
ports: | |
- 28123:8123 | |
- 29000:9000 | |
options: >- | |
--health-cmd="wget --no-verbose --tries=1 --spider http://localhost:8123/ping || exit 1" | |
--health-interval=10s | |
--health-timeout=5s | |
--health-retries=5 | |
--health-start-period=30s | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '18.x' | |
registry-url: 'https://registry.npmjs.org' | |
- name: Install pnpm | |
uses: pnpm/action-setup@v2 | |
with: | |
version: 8 | |
run_install: false | |
- name: Install dependencies and tools | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y jq | |
pnpm install | |
- name: Install ClickHouse client | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y apt-transport-https ca-certificates dirmngr wget gnupg | |
GNUPGHOME=$(mktemp -d) | |
sudo GNUPGHOME="$GNUPGHOME" gpg --no-default-keyring --keyring /usr/share/keyrings/clickhouse-keyring.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 8919F6BD2B48D754 | |
echo "deb [signed-by=/usr/share/keyrings/clickhouse-keyring.gpg] https://packages.clickhouse.com/deb stable main" | sudo tee /etc/apt/sources.list.d/clickhouse.list | |
sudo apt-get update | |
sudo apt-get install -y clickhouse-client | |
- name: Get pnpm store directory | |
shell: bash | |
run: | | |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | |
- uses: actions/cache@v3 | |
name: Setup pnpm cache | |
with: | |
path: ${{ env.STORE_PATH }} | |
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pnpm-store- | |
- name: Wait for ClickHouse | |
run: | | |
timeout 30s bash -c 'until wget --no-verbose --tries=1 --spider http://localhost:28123/ping; do sleep 1; done' | |
- name: Run tests | |
run: pnpm test | |
env: | |
CLICKHOUSE_PORT: 28123 | |
- name: Build | |
run: pnpm build |