Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adopt new testing docker-based #13

Merged
merged 3 commits into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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