name: Format

on:
  pull_request:

jobs:
  commit:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 0
      - uses: wagoid/commitlint-github-action@v2
        with:
          configFile: .commitlintrc.json
          helpURL: https://docs.pancakeswap.finance/code/contributing#committing
  code:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v2
      - name: Setup Node
        uses: actions/setup-node@v2.1.2
        with:
          node-version: 14.x
      - name: Install dependencies
        run: yarn install
      - name: Run check
        run: yarn format:check
