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

Ci #19

Open
wants to merge 10 commits into
base: main-v14
Choose a base branch
from
Open

Ci #19

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
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Root editor config file
root = true

# Common settings
[*]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
charset = utf-8

# python, js indentation settings
[{*.py,*.js,*.vue,*.css,*.scss,*.html}]
indent_style = tab
indent_size = 2
max_line_length = 99
74 changes: 74 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
[flake8]
ignore =
B001,
B007,
B009,
B010,
B950,
E101,
E111,
E114,
E116,
E117,
E121,
E122,
E123,
E124,
E125,
E126,
E127,
E128,
E131,
E201,
E202,
E203,
E211,
E221,
E222,
E223,
E224,
E225,
E226,
E228,
E231,
E241,
E242,
E251,
E261,
E262,
E265,
E266,
E271,
E272,
E273,
E274,
E301,
E302,
E303,
E305,
E306,
E402,
E501,
E502,
E701,
E702,
E703,
E741,
F401,
F403,
F405,
W191,
W291,
W292,
W293,
W391,
W503,
W504,
E711,
E129,
F841,
E713,
E712,

max-line-length = 200
exclude=,test_*.py
111 changes: 111 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
name: Linters
on:
push:
branches: [ version-13, version-14 ]
pull_request:
branches: [ version-13, version-14 ]

env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
prettier:
needs: [ py_json_merge ]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
fetch-depth: 2

- name: Prettify code
uses: creyD/[email protected]
with:
commit_message: "style: prettify code"

json_diff:
needs: [ py_json_merge ]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.ref }}
fetch-depth: 2

- name: Find JSON changes
id: changed-json
uses: tj-actions/[email protected]
with:
files: |
**/*.json
include_all_old_new_renamed_files: true

- name: Copy head paths files
run: |
mkdir head
touch head/acmr.txt
for file in ${{ steps.changed-json.outputs.added_files }}; do
echo "A,head/${file}" >> head/acmr.txt
cp --parents $file head/
done
for file in ${{ steps.changed-json.outputs.copied_files }}; do
echo "C,head/${file}" >> head/acmr.txt
cp --parents $file head/
done
for file in ${{ steps.changed-json.outputs.modified_files }}; do
echo "M,head/${file}" >> head/acmr.txt
cp --parents $file head/
done
for file in ${{ steps.changed-json.outputs.renamed_files }}; do
echo "R,head/${file}" >> head/acmr.txt
cp --parents $file head/
done

- name: Checkout base
run: git checkout $(git --no-pager log --oneline -n 2 | awk 'NR==2 {print $1}')

- name: Copy base paths
run: |
mkdir base
touch base/mrd.txt
for file in ${{ steps.changed-json.outputs.modified_files }}; do
echo "M,${file}" >> base/mrd.txt
done
for file in ${{ steps.changed-json.outputs.all_old_new_renamed_files }}; do
echo "R,${file}" >> base/mrd.txt
done
for file in ${{ steps.changed-json.outputs.deleted_files }}; do
echo "D,${file}" >> base/mrd.txt
done

- name: Setup requirements and script
run: |
pip install rich
pip install json_source_map
git clone --depth 1 https://gist.github.com/3eea518743067f1b971114f1a2016f69 fsjd

- name: Diff table
run: python3 fsjd/frappe_schema_json_diff.py base/mrd.txt head/acmr.txt 1

py_json_merge:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Fetch validator
run: git clone --depth 1 https://gist.github.com/f1bf2c11f78331b2417189c385022c28.git validate_json

- name: Validate JSON
run: python3 validate_json/validate_json.py ./

- name: Compile
run: python3 -m compileall -q ./

- name: Check merge
run: |
if grep -lr --exclude-dir=node_modules "^<<<<<<< " "${GITHUB_WORKSPACE}"
then echo "Found merge conflicts"
exit 1
fi
25 changes: 25 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Release
on:
push:
branches:
- version-13
- version-14
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "lts/*"
- name: Install dependencies
run: npm install
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release
10 changes: 6 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@
locale
.wnf-lang-status
*.swp
tags
sentry/docs/current
*.egg-info
dist/
build/
# build/
frappe/docs/current
.vscode
node_modules
.kdev4/
Expand All @@ -29,7 +28,7 @@ __pycache__/

# Distribution / packaging
.Python
build/
# build/
develop-eggs/
dist/
downloads/
Expand Down Expand Up @@ -190,3 +189,6 @@ typings/
# cypress
cypress/screenshots
cypress/videos

# JetBrains IDEs
.idea/
57 changes: 57 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
exclude: 'node_modules|.git'
default_stages: [commit]
fail_fast: false

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: trailing-whitespace
files: 'frappe.*'
exclude: '.*json$|.*txt$|.*csv|.*md|.*svg'
- id: check-yaml
- id: no-commit-to-branch
args: ['--branch', 'develop']
- id: check-merge-conflict
- id: check-ast
- id: check-json
- id: check-toml
- id: check-yaml
- id: debug-statements

- repo: https://github.com/asottile/pyupgrade
rev: v2.34.0
hooks:
- id: pyupgrade
args: ['--py310-plus']

- repo: https://github.com/frappe/black
rev: 951ccf4d5bb0d692b457a5ebc4215d755618eb68
hooks:
- id: black

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.7.1
hooks:
- id: prettier
types_or: [javascript]
# Ignore any files that might contain jinja / bundles
exclude: |
(?x)^(
frappe/public/dist/.*|
.*node_modules.*|
.*boilerplate.*|
frappe/www/website_script.js|
frappe/templates/includes/.*|
frappe/public/js/lib/.*
)$
- repo: https://github.com/PyCQA/flake8
rev: 5.0.4
hooks:
- id: flake8
additional_dependencies: ['flake8-bugbear']

ci:
autoupdate_schedule: weekly
skip: []
submodules: false
Loading