Skip to content

Commit

Permalink
Merge pull request #5 from Nesaq/add_workflow
Browse files Browse the repository at this point in the history
Add workflow
  • Loading branch information
dzencot committed Jul 20, 2022
2 parents e4d9346 + 1b8cff6 commit 7be3f9b
Show file tree
Hide file tree
Showing 11 changed files with 162 additions and 12 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/nodeci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Node CI

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x, 17.x, 18.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version}}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version}}
- name: Install
run: make install
- name: Run linter
run: make lint
# - name: Run tests
# run: make test
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ start:

deploy:
git push heroku main

lint-frontend:
make -C frontend lint
2 changes: 2 additions & 0 deletions frontend/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist
node_modules
18 changes: 18 additions & 0 deletions frontend/.eslintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
env:
browser: true
es2021: true
extends:
- eslint:recommended
- plugin:react/recommended
- airbnb-base
parserOptions:
ecmaFeatures:
jsx: true
ecmaVersion: latest
sourceType: module
plugins:
- react
rules:
import/extensions: 0
no-console: 0

6 changes: 5 additions & 1 deletion frontend/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,8 @@ start:
npm start

build:
npm build
npm build

lint:
npx eslint .

97 changes: 91 additions & 6 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,10 @@
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"eslint": "^8.20.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-plugin-react": "^7.30.1"
}
}
2 changes: 1 addition & 1 deletion frontend/src/locales/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default {
},
private: {
header: 'Private page!',
message: 'Logged user: {{username}}'
message: 'Logged user: {{username}}',
},
},
};
4 changes: 2 additions & 2 deletions frontend/src/locales/ru.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default {
},
private: {
header: 'Скрытая страница!',
message: 'Авторизован пользователь: {{username}}'
}
message: 'Авторизован пользователь: {{username}}',
},
},
};
6 changes: 4 additions & 2 deletions frontend/src/reportWebVitals.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
const reportWebVitals = onPerfEntry => {
const reportWebVitals = (onPerfEntry) => {
if (onPerfEntry && onPerfEntry instanceof Function) {
import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
import('web-vitals').then(({
getCLS, getFID, getFCP, getLCP, getTTFB,
}) => {
getCLS(onPerfEntry);
getFID(onPerfEntry);
getFCP(onPerfEntry);
Expand Down
1 change: 1 addition & 0 deletions frontend/src/setupTests.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
// allows you to do things like:
// expect(element).toHaveTextContent(/react/i)
// learn more: https://github.com/testing-library/jest-dom
// eslint-disable-next-line import/no-unresolved
import '@testing-library/jest-dom';

0 comments on commit 7be3f9b

Please sign in to comment.