Skip to content

Commit

Permalink
Set up GitHub actions (feathericons#295)
Browse files Browse the repository at this point in the history
* Remove precommit hook

* Add CI workflow

* Introducing linting error

This should fail CI

* Use node-version instead of version

* Simplify ESLint setup

* Format useSearch

* Add Actions Status badge to readme

* Fix lint error
  • Loading branch information
colebemis authored Nov 9, 2019
1 parent c823a6e commit 1a5e6d1
Show file tree
Hide file tree
Showing 8 changed files with 92 additions and 864 deletions.
1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

24 changes: 5 additions & 19 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,6 @@
{
"parser": "babel-eslint",
"extends": ["eslint:recommended", "react-app", "prettier"],
"plugins": ["prettier"],
"rules": {
"prettier/prettier": [
"error",
{
"singleQuote": true,
"trailingComma": "all",
"semi": false
}
],
"react/react-in-jsx-scope": "off",
"react/no-typos": "off"
},
"env": {
"browser": true
}
}
"extends": [
"react-app",
"plugin:prettier/recommended"
]
}
14 changes: 14 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/setup-node@master
with:
node-version: 10
- name: install
run: yarn
- name: lint
run: yarn lint
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# feathericons.com

[![Netlify Status](https://api.netlify.com/api/v1/badges/3c1945b2-05df-47a2-a2c6-af04dd3802f4/deploy-status)](https://app.netlify.com/sites/feather/deploys)
[![Actions Status](https://github.com/feathericons/feathericons.com/workflows/CI/badge.svg)](https://github.com/feathericons/feathericons.com/actions)

This repo contains the source code for [feathericons.com](https://feathericons.com).

Expand All @@ -21,4 +22,3 @@ npm run develop
```

> **Note:** This requires Node.js and npm to be set up locally, see [nodejs.org](https://nodejs.org) for more information.
23 changes: 5 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,7 @@
"prebuild": "./bin/build-zip.sh",
"build": "gatsby build",
"develop": "gatsby develop",
"lint": "eslint .",
"precommit": "lint-staged"
},
"lint-staged": {
"*.js": "eslint"
"lint": "eslint ."
},
"dependencies": {
"@emotion/core": "^10.0.22",
Expand All @@ -38,18 +34,9 @@
"use-query-params": "^0.3.3"
},
"devDependencies": {
"babel-eslint": "^8.2.1",
"eslint": "^4.11.0",
"eslint-config-prettier": "2.8.0",
"eslint-config-react-app": "^4.0.1",
"eslint-plugin-flowtype": "^4.3.0",
"eslint-plugin-import": "2.8.0",
"eslint-plugin-jsx-a11y": "6.0.3",
"eslint-plugin-prettier": "2.4.0",
"eslint-plugin-react": "^7.14.2",
"eslint-plugin-react-hooks": "^1.6.1",
"husky": "0.14.3",
"lint-staged": "6.0.0",
"prettier": "1.8.2"
"eslint-config-prettier": "^6.5.0",
"eslint-config-react-app": "^5.0.2",
"eslint-plugin-prettier": "^3.1.1",
"prettier": "^1.19.0"
}
}
7 changes: 4 additions & 3 deletions src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,10 @@ function IndexPage({ location }) {
paddingY: 4,
paddingX: 5,
background: theme =>
`linear-gradient(${theme.colors.muted} 75%, ${alpha('muted', 0)(
theme,
)})`,
`linear-gradient(${theme.colors.muted} 75%, ${alpha(
'muted',
0,
)(theme)})`,
zIndex: 1,
}}
>
Expand Down
17 changes: 7 additions & 10 deletions src/utils/useSearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,13 @@ const fuse = new Fuse(Object.values(icons), {
function useSearch(query) {
const [results, setResults] = React.useState(Object.values(icons))

React.useEffect(
() => {
if (query.trim()) {
setResults(fuse.search(query.trim()))
} else {
setResults(Object.values(icons))
}
},
[query],
)
React.useEffect(() => {
if (query.trim()) {
setResults(fuse.search(query.trim()))
} else {
setResults(Object.values(icons))
}
}, [query])

return results
}
Expand Down
Loading

0 comments on commit 1a5e6d1

Please sign in to comment.