Skip to content

Commit

Permalink
chore: Adopt new testing docker-based (#13)
Browse files Browse the repository at this point in the history
* Adopt new testing docker-based

* Fix code analysis, add remaining deps

* add eslitignore
  • Loading branch information
sneridagh authored and ericof committed Nov 17, 2023
1 parent 05ff301 commit d9251e7
Show file tree
Hide file tree
Showing 33 changed files with 5,308 additions and 2,239 deletions.
5 changes: 5 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
cypress
node_modules
acceptance
**/*.json
**/*.stories.jsx
53 changes: 53 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"extends": ["react-app", "prettier", "plugin:jsx-a11y/recommended"],
"plugins": ["prettier", "react-hooks", "jsx-a11y"],
"env": {
"es6": true,
"browser": true,
"node": true,
"mocha": true,
"jasmine": true
},
"parser": "@babel/eslint-parser",
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"ecmaFeatures": {
"legacyDecorators": true
}
},
"rules": {
"import/no-unresolved": 0,
"no-alert": 1,
"no-console": 1,
"no-debugger": 1,
"prettier/prettier": [
"error",
{ "trailingComma": "all", "singleQuote": true }
],
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
"react/react-in-jsx-scope": "off"
},
"settings": {
"react": {
"version": "17.0.2"
}
},
"globals": {
"root": true,
"__DEVELOPMENT__": true,
"__CLIENT__": true,
"__SERVER__": true,
"__DISABLE_SSR__": true,
"__DEVTOOLS__": true,
"__DEBUG__": true,
"__SSR__": true,
"__SENTRY__": true,
"cy": true,
"Cypress": true,
"jest": true,
"socket": true,
"webpackIsomorphicTools": true
}
}
43 changes: 6 additions & 37 deletions .github/workflows/code.yml
Original file line number Diff line number Diff line change
@@ -1,46 +1,15 @@
name: Code analysis checks
on: [push]
jobs:
build:
codeanalysis:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
python-version: [3.9]
env:
NAMESPACE: '@plone-collective'
GIT_NAME: volto-authomatic
GIT_USER: 'collective'
GIT_BRANCH: ${GITHUB_REF##*/}
node-version: [20.x]

steps:
- name: Main checkout
uses: actions/checkout@v2

# node setup
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'

# node install
- name: Install dependencies
run: yarn install

- name: Install yo and @plone/generator-volto
run: npm i -g yo @plone/generator-volto

- name: Setup addon testing environment
run: npx -p @plone/scripts addon clone https://github.com/${{env.GIT_USER}}/${{env.GIT_NAME}}.git --branch ${{env.GIT_BRANCH}}

# ESlint
- name: ESlint
run: cd addon-testing-project && yarn && yarn lint

# Stylelint
- name: Stylelint
run: cd addon-testing-project && yarn && yarn stylelint
uses: actions/checkout@v3

# Prettier
- name: Prettier
run: cd addon-testing-project && yarn && yarn prettier:ci
- name: Linting
run: make lint
15 changes: 6 additions & 9 deletions .github/workflows/storybook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,13 @@ jobs:
- name: Checkout
uses: actions/checkout@v2.3.1

- name: Create a new Volto project
run: |
make project
- name: Generate Storybook
run: |
make storybook
- name: Deploy to GitHub pages
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: addon-testing-project/storybook-static
# Come up with a way to extract it from the container
# - name: Deploy to GitHub pages
# uses: JamesIves/github-pages-deploy-action@v4
# with:
# branch: gh-pages
# folder: addon-testing-project/storybook-static
35 changes: 6 additions & 29 deletions .github/workflows/unit.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,15 @@
name: Unit tests
name: Unit Tests
on: [push]
jobs:
build:
unit:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
python-version: [3.9]
env:
NAMESPACE: '@plone-collective'
GIT_NAME: volto-authomatic
GIT_USER: 'collective'
GIT_BRANCH: ${GITHUB_REF##*/}
node-version: [20.x]

steps:
- name: Main checkout
uses: actions/checkout@v2

# node setup
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'

# node install
- name: Install dependencies
run: yarn install

- name: Install yo and @plone/generator-volto
run: npm i -g yo @plone/generator-volto

- name: Setup addon testing environment
run: npx -p @plone/scripts addon clone https://github.com/${{env.GIT_USER}}/${{env.GIT_NAME}}.git --branch ${{env.GIT_BRANCH}}
uses: actions/checkout@v3

# Unit tests
- name: Unit tests
run: cd addon-testing-project && yarn && CI=true yarn test
run: make test-ci
12 changes: 12 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"trailingComma": "all",
"singleQuote": true,
"overrides": [
{
"files": "*.overrides",
"options": {
"parser": "less"
}
}
]
}
33 changes: 33 additions & 0 deletions .stylelintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"extends": [
"stylelint-config-prettier",
"stylelint-config-idiomatic-order"
],
"plugins": [
"stylelint-prettier"
],
"overrides": [
{
"files": [
"**/*.less"
],
"customSyntax": "postcss-less"
},
{
"files": [
"**/*.overrides"
],
"customSyntax": "postcss-less"
},
{
"files": [
"**/*.scss"
],
"customSyntax": "postcss-scss"
}
],
"rules": {
"prettier/prettier": true,
"order/properties-alphabetical-order": null
}
}
Loading

0 comments on commit d9251e7

Please sign in to comment.