diff --git a/.github/workflows/validate-cli.yaml b/.github/workflows/validate-cli.yaml new file mode 100644 index 00000000..34577cc2 --- /dev/null +++ b/.github/workflows/validate-cli.yaml @@ -0,0 +1,61 @@ +name: Validate Cli + +on: + push: + branches: + - '!develop' + - '!main' + paths: + [ + 'apps/cli/**', + '.github/workflows/validate-cli.yml', + '.github/workflows/deploy-cli.yml' + ] + pull_request: + paths: + [ + 'apps/cli/**', + '.github/workflows/deploy-cli.yml', + '.github/workflows/validate-cli.yml' + ] + +jobs: + validate: + runs-on: ubuntu-latest + name: Validate Cli + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + + - name: Install pnpm + uses: pnpm/action-setup@v4 + with: + version: 9.2.0 + run_install: false + + - name: Get pnpm store directory + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV + + - uses: actions/cache@v4 + 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: Install packages + run: | + pnpm i + + - name: Lint + run: | + pnpm run lint:cli \ No newline at end of file diff --git a/package.json b/package.json index fd845f09..51451c08 100644 --- a/package.json +++ b/package.json @@ -103,6 +103,7 @@ "lint:api": "turbo run lint --filter=api", "lint:web": "turbo run lint --filter=web", "lint:platform": "turbo run lint --filter=platform", + "lint:cli": "turbo run lint --filter=cli", "lint:api-client": "pnpm run --filter=api-client lint", "build": "turbo run build", "build:api": "pnpm db:generate-types && turbo run build --filter=api",