Skip to content

Commit

Permalink
ci: add prettier check
Browse files Browse the repository at this point in the history
  • Loading branch information
varunsrin committed Aug 3, 2022
1 parent 9586412 commit caaacef
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 8 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: CI
on:
# CI is run on main because new branches can only access caches from master, not previous branches.
# So building on master allows new PR's to get the cache from before.
push:
branches: [main]
pull_request:
branches: [main]

jobs:
lint:
timeout-minutes: 5

runs-on: ubuntu-latest

steps:
- name: checkout
uses: actions/checkout@v3

- name: install node
uses: actions/setup-node@v3
with:
cache: "yarn"
node-version: "18"

- name: Restore cached dependencies for Node modules
id: module-cache
uses: actions/cache@v2
with:
path: ${{ github.workspace }}/node_modules
key: ${{ runner.os }}--node--${{ hashFiles('**/yarn.lock') }}

- name: Install dependencies
run: yarn install

- name: Run prettier check
run: yarn lint:check
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
8 changes: 0 additions & 8 deletions .prettierrc.js

This file was deleted.

6 changes: 6 additions & 0 deletions .prettierrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
semi: true
trailingComma: 'es5'
singleQuote: true
printWidth: 120
tabWidth: 2
useTabs: false
18 changes: 18 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "farcaster-protocol",
"version": "0.0.1",
"description": "specification of the farcaster protocol",
"main": "README.md",
"repository": "[email protected]:farcasterxyz/protocol.git",
"author": "Varun Srinivasan <[email protected]>",
"license": "unlicensed",
"devDependencies": {
"prettier": "^2.7.1"
},
"scripts": {
"lint": "yarn prettier",
"lint:check": "yarn prettier:check",
"prettier": "prettier --config \"./.prettierrc.yml\" --write \"**/*.{json,md}\"",
"prettier:check": "prettier --config \"./.prettierrc.yml\" --check \"**/*.{json,md}\""
}
}
8 changes: 8 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1


prettier@^2.7.1:
version "2.7.1"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.7.1.tgz#e235806850d057f97bb08368a4f7d899f7760c64"
integrity sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==

0 comments on commit caaacef

Please sign in to comment.