From b39ce510bfe3b4fedb8aa81deac4223ba695171c Mon Sep 17 00:00:00 2001 From: Daryl Collins Date: Wed, 27 Mar 2024 04:02:38 +0000 Subject: [PATCH] (chore): Define github workflows --- .github/workflows/_setup_env.yml | 6 +++++- .github/workflows/lint.yml | 29 +++++++++++++++++++++++++---- 2 files changed, 30 insertions(+), 5 deletions(-) diff --git a/.github/workflows/_setup_env.yml b/.github/workflows/_setup_env.yml index da07733..b3eff9a 100644 --- a/.github/workflows/_setup_env.yml +++ b/.github/workflows/_setup_env.yml @@ -1,4 +1,4 @@ -name: Configure environment +name: Configure env for lint or tests on: workflow_call: @@ -12,6 +12,10 @@ jobs: uses: pnpm/action-setup@v2 with: version: 6.32.9 + - name: Checkout repo + uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Set up Node.js uses: actions/setup-node@v3 with: diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 43f5cf7..f0b03c0 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -13,11 +13,22 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 10 steps: + - uses: ./.github/workflows/_setup_env.yml + - name: Install PNPM + uses: pnpm/action-setup@v2 + with: + version: 6.32.9 - name: Checkout repo uses: actions/checkout@v4 with: fetch-depth: 0 - - uses: ./.github/workflows/_setup_env.yml + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: '18' + cache: 'pnpm' + - name: Install project dependencies + run: pnpm install - name: Lint run: pnpm lint tests: @@ -26,10 +37,20 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 10 steps: + - name: Install PNPM + uses: pnpm/action-setup@v2 + with: + version: 6.32.9 - name: Checkout repo uses: actions/checkout@v4 with: fetch-depth: 0 - - uses: ./.github/workflows/_setup_env.yml - - name: Run tests - run: pnpm test + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: '18' + cache: 'pnpm' + - name: Install project dependencies + run: pnpm install + - name: Lint + run: pnpm lint