DEV Community

Vicky Vasilopoulou
Vicky Vasilopoulou

Posted on

1

Simple Github Workflow for Lint - Prettier & Jest (yarn)

For this workflow make sure you add your own version of node that you have installed on your machine


name: Master Preview

on:
  push:
    branches:
      - master
  pull_request:
    branches:
      - master
jobs:
  run-linters:
    name: Lint & Jest
    runs-on: ubuntu-latest
    steps:
      - name: Check out Git repository
        uses: actions/checkout@v2
      - name: Set up Node.js
        uses: actions/setup-node@v1
        with:
          node-version: v16.6.1
      - name: Install dependencies
        run: yarn --prefer-offline
      - name: Run linters
        run: yarn lint
      - name: Test
        run: yarn test
  prettier:
    name: Prettier
    runs-on: ubuntu-latest
    steps:
      - name: Check out Git repository
        uses: actions/checkout@v2
      - name: Set up Node.js
        uses: actions/setup-node@v1
        with:
          node-version: v16.6.1
      - name: Install dependencies
        run: yarn --prefer-offline
      - name: Run Prettier
        run: yarn run format
  build:
    runs-on: ubuntu-latest
    name: Build and Test
    steps:
      - uses: actions/checkout@v2
        name: Check out repository
      - uses: actions/setup-node@v1
        name: Set up Node.js
        with:
          node-version: 16.10.0
Enter fullscreen mode Exit fullscreen mode

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay