From 400022bd8d47a4e6a05d4db79662ef204b90fc1b Mon Sep 17 00:00:00 2001 From: Emil Gulamov <125820963+mearashadowfax@users.noreply.github.com> Date: Tue, 19 Mar 2024 17:22:09 +0400 Subject: [PATCH] Add GitHub Actions for tool setup and code quality checks Introduced new GitHub Actions workflows for installing necessary tools (PNPM, Node.js) and dependencies. Also added jobs to perform code quality checks using Astro and ESLint to ensure code quality and standards. --- .github/actions/install/action.yml | 18 +++++++++++++ .github/workflows/ci.yml | 43 ++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 .github/actions/install/action.yml create mode 100644 .github/workflows/ci.yml diff --git a/.github/actions/install/action.yml b/.github/actions/install/action.yml new file mode 100644 index 0000000..b044f30 --- /dev/null +++ b/.github/actions/install/action.yml @@ -0,0 +1,18 @@ +name: Install Tools & Dependencies +description: Installs pnpm, Node.js & package dependencies + +runs: + using: composite + steps: + - name: Setup PNPM + uses: pnpm/action-setup@v3 + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 18 + cache: pnpm + + - name: Install dependencies + run: pnpm install + shell: bash \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..1364684 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,43 @@ +name: Code Quality Check + +on: + push: + branches: [main] + pull_request: + branches: [main] + +concurrency: + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request_target' && github.head_ref || github.ref }} + cancel-in-progress: true + +env: + NODE_OPTIONS: "--max_old_space_size=4096" + +jobs: + astrocheck: + name: Check for type issues with astro check + runs-on: ubuntu-latest + env: + FORCE_COLOR: true + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install Tools & Dependencies + uses: ./.github/actions/install + + - name: Run Astro Check + run: pnpm run check + + eslint: + name: Check for code issues with ESLint + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install Tools & Dependencies + uses: ./.github/actions/install + + - name: Run ESLint + run: pnpm run lint:eslint