# This workflow will validate cloki using nodejs + clickhouse + npm without the git repository sources

name: CLOKI NPM CI

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:
  build:

    runs-on: ubuntu-latest

    strategy:
      matrix:
        node-version: [14.x]
        # See supported Node.js release schedule at https://nodejs.org/en/about/releases/

    steps:
    - uses: EpicStep/clickhouse-github-action@v1.0.0
    - name: Use Node.js ${{ matrix.node-version }}
      uses: actions/setup-node@v2
      with:
        node-version: ${{ matrix.node-version }}
    - run: npm install --unsafe-perm -g cloki
    - env:
        CLICKHOUSE_DB: loki
        DEBUG: true
      run: cd $(dirname $(readlink -f `which cloki`)) && (timeout 10s cloki || ( [[ $? -eq 124 ]] && exit 0 ))
#   - run: npm install -g jest
#   - run: cd $(dirname $(readlink -f `which cloki`)) && npm run test
