Skip to content

Commit

Permalink
Simplify CI setup (prettier#320)
Browse files Browse the repository at this point in the history
* Simplify CI setup

* Address review comments

* Update readme
  • Loading branch information
kaicataldo authored Sep 3, 2020
1 parent d64f137 commit 42fd0c2
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 30 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
ci:
name: CI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: "12.x"
- name: Install dependencies
run: yarn
- name: Check formatting
run: yarn format:check
- name: Lint files
run: yarn lint
- name: Run tests
run: yarn test-only
12 changes: 0 additions & 12 deletions .github/workflows/nodejs.yml

This file was deleted.

24 changes: 20 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ yarn build
To watch files and rebuild when files change in development:

```
yarn build:chrome:dev
yarn dev:chrome
# or
yan dev:firefox
```

To open React devtools for the options page:
Expand Down Expand Up @@ -55,18 +59,30 @@ To open React devtools for the options page:
yarn react-devtools
```

### Lint files

```
yarn lint
```

### Format files

```
yarn fix
yarn format
```

### Run tests (to be added in the future)

```
yarn test-only
```

### Test if everything is fine
### Run all of the above

```
yarn test
```

## Help

We need your [help](https://github.com/prettier/prettier-chrome-extension/issues) :)
We would love your [help](https://github.com/prettier/prettier-chrome-extension/issues) :)
23 changes: 9 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,14 @@
"build:chrome": "PLATFORM=chrome node scripts/build.js",
"build:firefox": "PLATFORM=firefox node scripts/build.js",
"build": "yarn build:chrome && yarn build:firefox",
"fix": "yarn fix:js && yarn fix:other",
"fix:other": "yarn prettier",
"fix:js": "yarn test:js --fix",
"prettier": "prettier . --write",
"build:chrome:dev": "PLATFORM=chrome node scripts/start.js",
"build:firefox:dev": "PLATFORM=firefox node scripts/start.js",
"dev:chrome": "PLATFORM=chrome node scripts/start.js",
"dev:firefox": "PLATFORM=firefox node scripts/start.js",
"launch:firefox": "web-ext run",
"test": "yarn test:other && yarn test:js && jest --passWithNoTests",
"test:other": "prettier . --check",
"test:js": "eslint --ignore-path .gitignore --ignore-path .prettierignore \"**/*.js\""
"lint": "eslint --ignore-path .gitignore \"**/*.js\"",
"format": "prettier . --write",
"format:check": "prettier . --check",
"test-only": "jest --passWithNoTests",
"test": "yarn format:check && yarn lint && yarn test-only"
},
"dependencies": {
"classnames": "2.2.6",
Expand Down Expand Up @@ -62,11 +60,8 @@
"webpack-cli": "3.3.12"
},
"lint-staged": {
"*.{js}": [
"eslint --ignore-path .gitignore --ignore-path .prettierignore --fix"
],
"*.{md,css,scss,html,json,yml}": [
"prettier --write"
"*.{js,md,css,scss,html,json,yml}": [
"yarn format"
]
},
"husky": {
Expand Down

0 comments on commit 42fd0c2

Please sign in to comment.