From 0c356dfddb0e977bcd2c58861347d364d2232886 Mon Sep 17 00:00:00 2001 From: Maurici Abad Gutierrez Date: Tue, 17 Oct 2023 09:59:13 +0000 Subject: [PATCH] Add Lint and fix CI --- .github/workflows/workflows/ci.yaml | 52 +++++++++++++++++++++++++++++ .prettierignore | 2 ++ 2 files changed, 54 insertions(+) create mode 100644 .github/workflows/workflows/ci.yaml create mode 100644 .prettierignore diff --git a/.github/workflows/workflows/ci.yaml b/.github/workflows/workflows/ci.yaml new file mode 100644 index 00000000..6a63eeff --- /dev/null +++ b/.github/workflows/workflows/ci.yaml @@ -0,0 +1,52 @@ +name: CI +on: push +jobs: + lintfix: + name: Lint and fix + runs-on: ubuntu-latest + steps: + - name: 🚀 Checkout + uses: actions/checkout@v3 + + - name: 🎯 Read .nvmrc + run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)" + id: nvm + + - name: 🏗️ Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: '${{ steps.nvm.outputs.NVMRC }}' + + - name: 📦 Setup pnpm - Install pnpm + uses: pnpm/action-setup@v2 + with: + run_install: false + + - name: 📦 Setup pnpm - Get pnpm store directory + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV + + - name: 📦 Setup pnpm - Setup pnpm cache + uses: actions/cache@v3 + with: + path: ${{ env.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- + + - name: 📦 Install dependencies + run: pnpm install + + - name: 🔦 Run lint + run: pnpm lint --fix + + - name: 🖌️ Run format + run: pnpm format + + - name: 🍾 Commit & Push changes + uses: actions-js/push@master + with: + message: 'chore: Auto-fix lint errors' + github_token: ${{ secrets.GITHUB_TOKEN }} + branch: ${{ github.ref }} diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 00000000..64e88c47 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,2 @@ +/drizzle +pnpm-lock.yaml