Skip to content

fix yarn

fix yarn #128

Workflow file for this run

name: Prettier and Markdownlint test
# This action works with pull requests and pushes
on: push
permissions: read-all
jobs:
prettier:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
# Make sure the actual branch is checked out when running on pull requests
ref: ${{ github.head_ref }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
# cache: 'yarn' # workaround because setup-node+Yarn Berry error
- name: Enable Corepack
run: corepack enable
- name: Cache Yarn # workaround because setup-node+Yarn Berry error
uses: actions/cache@v4
id: yarn-cache
with:
path: ~/.yarn/cache
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn install --immutable
- name: Prettify code # Must use yarn script instead of a prettier action, in order to load plugins from .prettierrc.js
run: yarn run prettier --check "**/*.{js,css,html}"
markdownlint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
# cache: 'yarn' # workaround because setup-node+Yarn Berry error
- name: Enable Corepack
run: corepack enable
- name: Cache Yarn # workaround because setup-node+Yarn Berry error
uses: actions/cache@v4
id: yarn-cache
with:
path: ~/.yarn/cache
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn install --immutable
- name: Run markdownlint
run: yarn run markdownlint "**/*.md"