Skip to content

Commit

Permalink
fix: Setup yarn correctly for linting-action file
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexMachin1997 committed Oct 31, 2024
1 parent ac1e558 commit 364b87d
Showing 1 changed file with 29 additions and 6 deletions.
35 changes: 29 additions & 6 deletions .github/workflows/linting-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,41 @@ jobs:
name: Run linters
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x, 20.x]

steps:
- name: Check out Git repository
uses: actions/checkout@v4
uses: actions/checkout@v2

- name: Set up Node.js version ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- name: Enable Corepack
run: corepack enable

- name: Set Yarn version
run: yarn set version 4.2.2

- name: Set up Node.js
uses: actions/setup-node@v3
- name: Cache yarn dependencies
uses: actions/cache@v2
env:
cache-name: cache-yarn-dependencies
with:
node-version: 20
cache: 'yarn'
path: |
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn install --frozen-lockfile
run: yarn install

- name: Run linters
run: yarn lint # assumes you have a `lint` script in package.json for ESLint and Prettier

0 comments on commit 364b87d

Please sign in to comment.