Skip to content

Standardize eslint and prettier for the entire project with ci checks #157

Standardize eslint and prettier for the entire project with ci checks

Standardize eslint and prettier for the entire project with ci checks #157

Workflow file for this run

name: ci
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
example: ['examples/create-react-app', 'examples/nextjs', 'examples/typescript']
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up node ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Cache library
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-${{ matrix.node-version }}-
${{ runner.os }}-node-
${{ runner.os }}-
- name: Install dependencies
run: npm ci
- name: Cache examples
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ matrix.node-version }}-${{ matrix.example }}-${{ hashFiles(format('{0}/package-lock.json', matrix.example)) }}
restore-keys: |
${{ runner.os }}-node-${{ matrix.node-version }}-${{ matrix.example }}-
${{ runner.os }}-node-${{ matrix.node-version }}-
${{ runner.os }}-node-
${{ runner.os }}-
- name: Install dependencies for ${{ matrix.example }}
run: npm ci
working-directory: ${{ matrix.example }}
- name: Lint
uses: wearerequired/lint-action@v2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
prettier: true
eslint: true
eslint_args: '--max-warnings 0'
- name: Test
run: npm run test