diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 284b484deb..deaaf34545 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -4,5 +4,4 @@ # These owners will be the default owners for everything in # the repo. Unless a later match takes precedence. -* @akashkrishna619 -* @akurungadam +* @akurungadam @akashkrishna619 diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000000..5ace4600a1 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" diff --git a/.github/helper/install.sh b/.github/helper/install.sh index 1e914a7544..b54cdebb77 100644 --- a/.github/helper/install.sh +++ b/.github/helper/install.sh @@ -8,7 +8,7 @@ sudo apt-get install redis-server libcups2-dev -qq pip install frappe-bench -git clone https://github.com/frappe/frappe --branch develop --depth 1 +git clone https://github.com/frappe/frappe --branch "$BRANCH_TO_CLONE" --depth 1 bench init --skip-assets --frappe-path ~/frappe --python "$(which python)" frappe-bench mkdir ~/frappe-bench/sites/test_site @@ -18,7 +18,6 @@ mysql --host 127.0.0.1 --port 3306 -u root -e "SET GLOBAL character_set_server = mysql --host 127.0.0.1 --port 3306 -u root -e "SET GLOBAL collation_server = 'utf8mb4_unicode_ci'" mysql --host 127.0.0.1 --port 3306 -u root -e "CREATE DATABASE test_frappe" - mysql --host 127.0.0.1 --port 3306 -u root -e "CREATE USER 'test_frappe'@'localhost' IDENTIFIED BY 'test_frappe'" mysql --host 127.0.0.1 --port 3306 -u root -e "GRANT ALL PRIVILEGES ON \`test_frappe\`.* TO 'test_frappe'@'localhost'" @@ -28,22 +27,30 @@ mysql --host 127.0.0.1 --port 3306 -u root -e "GRANT ALL PRIVILEGES ON \`test_fr mysql --host 127.0.0.1 --port 3306 -u root -e "UPDATE mysql.user SET Password=PASSWORD('travis') WHERE User='root'" mysql --host 127.0.0.1 --port 3306 -u root -e "FLUSH PRIVILEGES" +install_whktml() { + wget -O /tmp/wkhtmltox.tar.xz https://github.com/frappe/wkhtmltopdf/raw/master/wkhtmltox-0.12.3_linux-generic-amd64.tar.xz + tar -xf /tmp/wkhtmltox.tar.xz -C /tmp + sudo mv /tmp/wkhtmltox/bin/wkhtmltopdf /usr/local/bin/wkhtmltopdf + sudo chmod o+x /usr/local/bin/wkhtmltopdf +} +install_whktml & cd ~/frappe-bench || exit - sed -i 's/watch:/# watch:/g' Procfile sed -i 's/schedule:/# schedule:/g' Procfile sed -i 's/socketio:/# socketio:/g' Procfile sed -i 's/redis_socketio:/# redis_socketio:/g' Procfile -bench get-app erpnext --branch develop --resolve-deps -bench get-app payments --branch develop --resolve-deps - +bench get-app payments --resolve-deps +bench get-app https://github.com/frappe/erpnext --branch "$BRANCH_TO_CLONE" --resolve-deps bench setup requirements --dev -bench start & + +bench start &> bench_run_logs.txt & +CI=Yes bench build --app frappe & bench --site test_site reinstall --yes bench get-app healthcare "${GITHUB_WORKSPACE}" bench --verbose --site test_site install-app healthcare +bench setup requirements --dev diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9ca4b37f4b..3f9a00b03c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,17 +2,36 @@ name: CI on: push: - branches: - - main + branches: [develop, version-14-hotfix, version-14] + paths-ignore: + - "**.css" + - "**.js" + - "**.md" + - "**.html" + - "**.csv" + pull_request: - branches: - - develop + paths-ignore: + - "**.css" + - "**.js" + - "**.md" + - "**.html" + - "**.csv" + schedule: + # Run everday at midnight UTC / 5:30 IST + - cron: "0 0 * * *" +env: + FH_BRANCH: ${{ github.base_ref || github.ref_name }} + +concurrency: + group: develop-${{ github.event.number }} + cancel-in-progress: true jobs: linters: + name: Linters runs-on: ubuntu-latest steps: - - name: Checkout Code Repository uses: actions/checkout@v3 @@ -25,7 +44,7 @@ jobs: uses: pre-commit/action@v2.0.0 tests: - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest timeout-minutes: 20 strategy: @@ -54,7 +73,7 @@ jobs: - name: Setup Node uses: actions/setup-node@v2 with: - node-version: 14 + node-version: 16 check-latest: true - name: Add to Hosts @@ -68,6 +87,7 @@ jobs: restore-keys: | ${{ runner.os }}-pip- ${{ runner.os }}- + - name: Cache node modules uses: actions/cache@v2 env: @@ -98,7 +118,7 @@ jobs: cd ~/frappe-bench/ && source env/bin/activate cd apps/healthcare && pip install -r dev-requirements.txt env: - TYPE: server + BRANCH_TO_CLONE: ${{ env.FH_BRANCH }} - name: Run Tests run: cd ~/frappe-bench/ && bench --site test_site run-tests --app healthcare diff --git a/.mergify.yml b/.mergify.yml new file mode 100644 index 0000000000..74ba41d9b5 --- /dev/null +++ b/.mergify.yml @@ -0,0 +1,56 @@ +pull_request_rules: + - name: Auto-close PRs on stable branch + conditions: + - and: + - and: + - author!=akashkrishna619 + - author!=akurungadam + - author!=frappe-pr-bot + - author!=mergify[bot] + - base=version-14 + actions: + close: + comment: + message: | + @{{author}}, thanks for the contribution, but we do not accept pull requests on a stable branch. Please raise PR on an appropriate hotfix branch or the develop branch. + + - name: Automatic merge on CI success and review + conditions: + - label!=dont-merge + - label!=squash + - "#approved-reviews-by>=1" + actions: + merge: + method: merge + + - name: Automatic squash on CI success and review + conditions: + - label!=dont-merge + - label=squash + - "#approved-reviews-by>=1" + actions: + merge: + method: squash + commit_message_template: | + {{ title }} (#{{ number }}) + {{ body }} + + - name: backport to develop + conditions: + - label="backport develop" + actions: + backport: + branches: + - develop + assignees: + - "{{ author }}" + + - name: backport to version-14-hotfix + conditions: + - label="backport version-14-hotfix" + actions: + backport: + branches: + - version-14-hotfix + assignees: + - "{{ author }}" diff --git a/healthcare/__init__.py b/healthcare/__init__.py index f102a9cadf..88349fdef9 100644 --- a/healthcare/__init__.py +++ b/healthcare/__init__.py @@ -1 +1 @@ -__version__ = "0.0.1" +__version__ = "15.0.0-dev"