-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c18039d
commit 53eb8da
Showing
6 changed files
with
460 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,75 +1,82 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- develop | ||
pull_request: | ||
branches: | ||
- main | ||
- develop | ||
push: | ||
branches: | ||
- main | ||
- develop | ||
pull_request: | ||
branches: | ||
- main | ||
- develop | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.12" | ||
- uses: actions/checkout@v4 | ||
- uses: nanasess/setup-chromedriver@master | ||
- name: Install dependencies | ||
run: | | ||
sudo apt update | ||
sudo apt install libjpeg-dev python3-dev python3-pip gettext zlib1g-dev git nodejs build-essential | ||
wget https://github.com/jgm/pandoc/releases/download/3.2.1/pandoc-3.2.1-1-amd64.deb -O pandoc.deb | ||
sudo dpkg -i pandoc.deb | ||
cd fiduswriter | ||
mv ../ci/configuration.py ./ | ||
pip install requests[security] | ||
pip install coverage | ||
pip install coveralls | ||
pip install packaging | ||
pip install webdriver-manager | ||
pip install selenium | ||
pip install wheel | ||
pip install pip --upgrade | ||
if grep version ../pyproject.toml | grep -q "dev"; | ||
then pip install https://github.com/fiduswriter/fiduswriter/archive/develop.zip; | ||
else pip install https://github.com/fiduswriter/fiduswriter/archive/main.zip; | ||
fi | ||
coverage run $(which fiduswriter) setup --no-static | ||
- name: Run pandoc server | ||
run: pandoc server & | ||
- name: Run test pandoc | ||
uses: nick-invision/retry@v3 | ||
with: | ||
timeout_minutes: 8 | ||
max_attempts: 3 | ||
retry_on: error | ||
command: | | ||
cd fiduswriter | ||
coverage run $(which fiduswriter) test pandoc | ||
- name: Upload failed test screenshots | ||
if: ${{ failure() }} | ||
uses: actions/[email protected] | ||
with: | ||
name: failure-artifacts | ||
path: ${{ github.workspace }}/fiduswriter/screenshots/ | ||
- name: Coveralls | ||
run: | | ||
cd fiduswriter | ||
coveralls --service=github | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
finish: | ||
needs: test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Coveralls Finished | ||
run: curl "https://coveralls.io/webhook?repo_token=${{ secrets.GITHUB_TOKEN }}&repo_name=${{ github.repository }}" -d "payload[build_num]=${{ github.run_id }}&payload[status]=done" | ||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
jobs: | ||
pre-commit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/[email protected] | ||
- uses: actions/[email protected] | ||
with: | ||
python-version: "3.13" | ||
- uses: pre-commit/[email protected] | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.13" | ||
- uses: actions/checkout@v4 | ||
- uses: nanasess/setup-chromedriver@master | ||
- name: Install dependencies | ||
run: | | ||
sudo apt update | ||
sudo apt install libjpeg-dev python3-dev python3-pip gettext zlib1g-dev git nodejs build-essential | ||
wget https://github.com/jgm/pandoc/releases/download/3.2.1/pandoc-3.2.1-1-amd64.deb -O pandoc.deb | ||
sudo dpkg -i pandoc.deb | ||
cd fiduswriter | ||
mv ../ci/configuration.py ./ | ||
pip install requests[security] | ||
pip install coverage | ||
pip install coveralls | ||
pip install packaging | ||
pip install webdriver-manager | ||
pip install selenium | ||
pip install wheel | ||
pip install pip --upgrade | ||
if grep version ../pyproject.toml | grep -q "dev"; | ||
then pip install https://github.com/fiduswriter/fiduswriter/archive/develop.zip; | ||
else pip install https://github.com/fiduswriter/fiduswriter/archive/main.zip; | ||
fi | ||
coverage run $(which fiduswriter) setup --no-static | ||
- name: Run pandoc server | ||
run: pandoc server & | ||
- name: Run test pandoc | ||
uses: nick-invision/retry@v3 | ||
with: | ||
timeout_minutes: 8 | ||
max_attempts: 3 | ||
retry_on: error | ||
command: | | ||
cd fiduswriter | ||
coverage run $(which fiduswriter) test pandoc | ||
- name: Upload failed test screenshots | ||
if: ${{ failure() }} | ||
uses: actions/[email protected] | ||
with: | ||
name: failure-artifacts | ||
path: ${{ github.workspace }}/fiduswriter/screenshots/ | ||
- name: Coveralls | ||
run: | | ||
cd fiduswriter | ||
coveralls --service=github | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
finish: | ||
needs: test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Coveralls Finished | ||
run: curl "https://coveralls.io/webhook?repo_token=${{ secrets.GITHUB_TOKEN }}&repo_name=${{ github.repository }}" -d "payload[build_num]=${{ github.run_id }}&payload[status]=done" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
repos: | ||
- repo: https://github.com/psf/black-pre-commit-mirror | ||
rev: 24.10.0 | ||
hooks: | ||
- id: black | ||
args: [--line-length=79] | ||
language_version: python3.13 | ||
- repo: https://github.com/pycqa/flake8 | ||
rev: '7.1.1' | ||
hooks: | ||
- id: flake8 | ||
entry: flake8 --extend-ignore E203,E501 | ||
- repo: https://github.com/biomejs/pre-commit | ||
rev: "75149f4e3b63c4df805860d7b04186d56dcbc05c" | ||
hooks: | ||
- id: biome-check | ||
#entry: biome check --files-ignore-unknown=true --no-errors-on-unmatched --fix --unsafe | ||
additional_dependencies: ["@biomejs/[email protected]"] | ||
- repo: https://github.com/awebdeveloper/pre-commit-stylelint | ||
rev: "4200758f4cb2f53dd06898dd8dca35e4b8cfb785" | ||
hooks: | ||
- id: stylelint | ||
additional_dependencies: | ||
[ | ||
"[email protected]", | ||
"[email protected]", | ||
"[email protected]", | ||
"[email protected]", | ||
] | ||
- repo: local | ||
hooks: | ||
- id: django-import-resolver | ||
name: Django Import Resolver | ||
entry: node lint/django_import_resolver.js | ||
language: node | ||
files: \.js$ | ||
additional_dependencies: ["[email protected]"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,170 @@ | ||
{ | ||
"formatter": { | ||
"enabled": true, | ||
"useEditorconfig": true, | ||
"formatWithErrors": false, | ||
"indentStyle": "space", | ||
"indentWidth": 4, | ||
"lineEnding": "lf", | ||
"lineWidth": 80, | ||
"attributePosition": "auto", | ||
"bracketSpacing": true, | ||
"ignore": [ | ||
"**/.transpile-cache/", | ||
"**/venv/", | ||
"**/static-transpile/", | ||
"**/static-libs/", | ||
"**/static-collected/", | ||
"**/node-modules/", | ||
"**/testing/", | ||
"**/.eslintrc.mjs", | ||
"**/*.json", | ||
"**/*.html", | ||
"**/.direnv", | ||
"**/venv", | ||
"**/.transpile", | ||
"**/.babelrc", | ||
"**/sw-template.js" | ||
] | ||
}, | ||
"linter": { | ||
"enabled": true, | ||
"rules": { | ||
"recommended": false, | ||
"complexity": { | ||
"noExtraBooleanCast": "error", | ||
"noMultipleSpacesInRegularExpressionLiterals": "error", | ||
"noUselessCatch": "off", | ||
"noUselessConstructor": "off", | ||
"noUselessLabel": "error", | ||
"noUselessLoneBlockStatements": "error", | ||
"noUselessRename": "error", | ||
"noUselessStringConcat": "error", | ||
"noUselessTernary": "off", | ||
"noUselessUndefinedInitialization": "error", | ||
"noVoid": "error", | ||
"noWith": "error", | ||
"useLiteralKeys": "off" | ||
}, | ||
"correctness": { | ||
"noConstAssign": "error", | ||
"noConstantCondition": "error", | ||
"noEmptyCharacterClassInRegex": "error", | ||
"noEmptyPattern": "error", | ||
"noGlobalObjectCalls": "error", | ||
"noInnerDeclarations": "error", | ||
"noInvalidConstructorSuper": "error", | ||
"noInvalidUseBeforeDeclaration": "off", | ||
"noNewSymbol": "error", | ||
"noNonoctalDecimalEscape": "error", | ||
"noPrecisionLoss": "error", | ||
"noSelfAssign": "error", | ||
"noSetterReturn": "error", | ||
"noSwitchDeclarations": "error", | ||
"noUndeclaredVariables": "error", | ||
"noUnreachable": "error", | ||
"noUnreachableSuper": "error", | ||
"noUnsafeFinally": "error", | ||
"noUnsafeOptionalChaining": "error", | ||
"noUnusedLabels": "error", | ||
"noUnusedVariables": "error", | ||
"useArrayLiterals": "error", | ||
"useIsNan": "error", | ||
"useValidForDirection": "error", | ||
"useYield": "error" | ||
}, | ||
"security": { "noGlobalEval": "error" }, | ||
"style": { | ||
"noArguments": "off", | ||
"noCommaOperator": "error", | ||
"noNegationElse": "off", | ||
"noParameterAssign": "off", | ||
"noRestrictedGlobals": { "level": "error", "options": {} }, | ||
"noVar": "error", | ||
"noYodaExpression": "off", | ||
"useBlockStatements": "error", | ||
"useCollapsedElseIf": "off", | ||
"useConsistentBuiltinInstantiation": "error", | ||
"useConst": "warn", | ||
"useDefaultSwitchClause": "off", | ||
"useNumericLiterals": "error", | ||
"useShorthandAssign": "off", | ||
"useSingleVarDeclarator": "off", | ||
"useTemplate": "off" | ||
}, | ||
"suspicious": { | ||
"noAsyncPromiseExecutor": "error", | ||
"noCatchAssign": "error", | ||
"noClassAssign": "error", | ||
"noCompareNegZero": "error", | ||
"noControlCharactersInRegex": "off", | ||
"noDebugger": "error", | ||
"noDoubleEquals": "off", | ||
"noDuplicateCase": "error", | ||
"noDuplicateClassMembers": "error", | ||
"noDuplicateObjectKeys": "error", | ||
"noDuplicateParameters": "error", | ||
"noEmptyBlockStatements": "off", | ||
"noFallthroughSwitchClause": "error", | ||
"noFunctionAssign": "error", | ||
"noGlobalAssign": "error", | ||
"noImportAssign": "error", | ||
"noLabelVar": "error", | ||
"noMisleadingCharacterClass": "error", | ||
"noPrototypeBuiltins": "off", | ||
"noRedeclare": "error", | ||
"noSelfCompare": "error", | ||
"noShadowRestrictedNames": "error", | ||
"noSparseArray": "error", | ||
"noUnsafeNegation": "error", | ||
"useAwait": "error", | ||
"useGetterReturn": "error", | ||
"useValidTypeof": "error" | ||
} | ||
}, | ||
"ignore": [ | ||
"**/.transpile-cache/", | ||
"**/venv/", | ||
"**/static-transpile/", | ||
"**/static-libs/", | ||
"**/static-collected/", | ||
"**/testing/", | ||
"**/manifest.json", | ||
"**/sw-template.js" | ||
] | ||
}, | ||
"javascript": { | ||
"formatter": { | ||
"jsxQuoteStyle": "double", | ||
"quoteProperties": "asNeeded", | ||
"trailingCommas": "none", | ||
"semicolons": "asNeeded", | ||
"indentWidth": 4, | ||
"arrowParentheses": "asNeeded", | ||
"bracketSameLine": true, | ||
"quoteStyle": "double", | ||
"attributePosition": "auto", | ||
"bracketSpacing": false | ||
}, | ||
"globals": [ | ||
"settings_MEDIA_MAX_SIZE", | ||
"settings_SOCIALACCOUNT_OPEN", | ||
"settings_REGISTRATION_OPEN", | ||
"gettext", | ||
"interpolate", | ||
"settings_USE_SERVICE_WORKER", | ||
"transpile_VERSION", | ||
"settings_TEST_SERVER", | ||
"settings_DEBUG", | ||
"settings_SOURCE_MAPS", | ||
"settings_STATIC_URL", | ||
"settings_PASSWORD_LOGIN", | ||
"process", | ||
"staticUrl", | ||
"settings_CONTACT_EMAIL", | ||
"settings_IS_FREE", | ||
"settings_FOOTER_LINKS", | ||
"settings_BRANDING_LOGO" | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pre-commit==4.0.1 |
Oops, something went wrong.