Skip to content

Commit f65bdee

Browse files
chore: update github workflows
1 parent f33e699 commit f65bdee

7 files changed

Lines changed: 115 additions & 82 deletions

File tree

‎.github/helper/install.sh‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ cd ~ || exit
66

77
sudo apt-get update
88
sudo apt-get -y remove mysql-server mysql-client
9-
sudo apt-get -y install redis-server libcups2-dev mariadb-client-10.6 -qq
9+
sudo apt-get -y install redis-server libcups2-dev mariadb-client -qq
1010

1111
pip install frappe-bench
1212

13-
git clone https://github.com/frappe/frappe --branch develop --depth 1
13+
git clone https://github.com/frappe/frappe --branch version-15 --depth 1
1414
bench init --skip-assets --frappe-path ~/frappe --python "$(which python)" frappe-bench
1515

1616
mkdir ~/frappe-bench/sites/test_site
@@ -33,11 +33,9 @@ sed -i 's/socketio:/# socketio:/g' Procfile
3333
sed -i 's/redis_socketio:/# redis_socketio:/g' Procfile
3434

3535
bench get-app payments --branch develop
36-
bench get-app erpnext --branch develop
36+
bench get-app erpnext --branch version-15
37+
bench get-app ecommerce_integrations "${GITHUB_WORKSPACE}"
3738

3839
bench start &
3940
bench --site test_site reinstall --yes
40-
41-
bench get-app ecommerce_integrations "${GITHUB_WORKSPACE}"
42-
bench --site test_site install-app ecommerce_integrations
4341
bench setup requirements --dev

‎.github/helper/site_config.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111
"root_login": "root",
1212
"root_password": "root",
1313
"host_name": "http://test_site:8000",
14-
"install_apps": ["payments", "erpnext"],
14+
"install_apps": ["payments", "erpnext", "ecommerce_integrations"],
1515
"throttle_user_limit": 100
1616
}

‎.github/workflows/ci.yml‎

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,24 @@ name: CI
33
on:
44
push:
55
branches:
6-
- develop
6+
- main
7+
- version-15
78
pull_request:
89
branches:
9-
- develop
1010
- main
11+
- version-15
12+
paths-ignore:
13+
- "**.css"
14+
- "**.js"
15+
- "**.md"
16+
- "**.html"
17+
- "**.csv"
18+
schedule:
19+
# Run everyday at midnight UTC / 5:30 IST
20+
- cron: "0 0 * * *"
21+
22+
env:
23+
ECOMMERCE_BRANCH: ${{ github.base_ref || github.ref_name }}
1124

1225
concurrency:
1326
group: develop-${{ github.event.number }}
@@ -30,11 +43,11 @@ jobs:
3043
MARIADB_ROOT_PASSWORD: 'root'
3144
ports:
3245
- 3306:3306
33-
options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3
46+
options: --health-cmd="mariadb-admin ping" --health-interval=5s --health-timeout=2s --health-retries=3
3447

3548
steps:
3649
- name: Clone
37-
uses: actions/checkout@v2
50+
uses: actions/checkout@v4
3851

3952
- name: Setup Python
4053
uses: actions/setup-python@v2
@@ -51,15 +64,16 @@ jobs:
5164
run: echo "127.0.0.1 test_site" | sudo tee -a /etc/hosts
5265

5366
- name: Cache pip
54-
uses: actions/cache@v2
67+
uses: actions/cache@v4
5568
with:
5669
path: ~/.cache/pip
57-
key: ${{ runner.os }}-pip-${{ hashFiles('**/*requirements.txt') }}
70+
key: ${{ runner.os }}-pip-${{ hashFiles('**/*requirements.txt', '**/pyproject.toml') }}
5871
restore-keys: |
5972
${{ runner.os }}-pip-
6073
${{ runner.os }}-
74+
6175
- name: Cache node modules
62-
uses: actions/cache@v2
76+
uses: actions/cache@v4
6377
env:
6478
cache-name: cache-node-modules
6579
with:
@@ -74,7 +88,7 @@ jobs:
7488
id: yarn-cache-dir-path
7589
run: echo "::set-output name=dir::$(yarn cache dir)"
7690

77-
- uses: actions/cache@v2
91+
- uses: actions/cache@v4
7892
id: yarn-cache
7993
with:
8094
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
@@ -85,6 +99,8 @@ jobs:
8599
- name: Install
86100
run: |
87101
bash ${GITHUB_WORKSPACE}/.github/helper/install.sh
102+
env:
103+
BRANCH_TO_CLONE: ${{ env.ECOMMERCE_BRANCH }}
88104

89105

90106
- name: Run Tests

‎.github/workflows/linters.yml‎

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
11
name: Linters
22

33
on:
4-
pull_request: { }
4+
pull_request:
5+
branches:
6+
- main
7+
- version-15
58

69
jobs:
7-
810
linters:
911
name: linters
1012
runs-on: ubuntu-latest
1113
steps:
12-
- uses: actions/checkout@v2
14+
- uses: actions/checkout@v4
1315

14-
- name: Set up Python 3.8
15-
uses: actions/setup-python@v2
16+
- name: Set up Python 3.10
17+
uses: actions/setup-python@v5
1618
with:
17-
python-version: 3.8
19+
python-version: '3.10'
20+
cache: pip
1821

1922
- name: Install and Run Pre-commit
20-
uses: pre-commit/action@v2.0.3
23+
uses: pre-commit/action@v3.0.0
2124

2225
- name: Download Semgrep rules
2326
run: git clone --depth 1 https://github.com/frappe/semgrep-rules.git frappe-semgrep-rules
2427

25-
- uses: returntocorp/semgrep-action@v1
26-
env:
27-
SEMGREP_TIMEOUT: 120
28-
with:
29-
config: >-
30-
r/python.lang.correctness
31-
./frappe-semgrep-rules/rules
28+
- name: Run Semgrep rules
29+
run: |
30+
pip install semgrep==1.90.0
31+
semgrep ci --config ./frappe-semgrep-rules/rules --config r/python.lang.correctness

‎.github/workflows/release.yml‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,21 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- name: Checkout Repository
12-
uses: actions/checkout@v2
12+
uses: actions/checkout@v4
1313
with:
1414
fetch-depth: 0
15-
- name: Setup Node.js v14
16-
uses: actions/setup-node@v2
15+
persist-credentials: false
16+
- name: Setup Node.js
17+
uses: actions/setup-node@v4
1718
with:
1819
node-version: 20
1920
- name: Setup dependencies
2021
run: |
2122
npm install @semantic-release/git @semantic-release/exec --no-save
2223
- name: Create Release
2324
env:
24-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25+
GH_TOKEN: ${{ secrets.RELEASE_TOKEN || secrets.GITHUB_TOKEN }}
26+
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN || secrets.GITHUB_TOKEN }}
2527
GIT_AUTHOR_NAME: "Frappe PR Bot"
2628
GIT_AUTHOR_EMAIL: "developers@frappe.io"
2729
GIT_COMMITTER_NAME: "Frappe PR Bot"

‎.pre-commit-config.yaml‎

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,34 @@
11
exclude: 'node_modules|.git'
2-
default_stages: [commit]
3-
fail_fast: true
2+
default_stages: [pre-commit]
3+
fail_fast: false
44

55
repos:
66
- repo: https://github.com/pre-commit/pre-commit-hooks
7-
rev: v4.0.1
7+
rev: v4.3.0
88
hooks:
99
- id: trailing-whitespace
1010
files: "ecommerce_integrations.*"
11+
exclude: ".*json$|.*txt$|.*csv|.*md|.*svg"
1112
- id: end-of-file-fixer
1213
files: "ecommerce_integrations.*"
1314
exclude: ".*json$|.*txt$"
1415
- id: check-yaml
16+
- id: check-merge-conflict
17+
- id: check-ast
18+
- id: check-json
19+
- id: check-toml
20+
- id: debug-statements
1521

16-
- repo: https://github.com/adityahase/black
17-
rev: 364d1ddcf58eb6bad2e0b757329f06f40ea83044
22+
- repo: https://github.com/astral-sh/ruff-pre-commit
23+
rev: v0.2.0
1824
hooks:
19-
- id: black
20-
exclude: ".*setup.py$"
21-
additional_dependencies: ['click==8.0.4']
22-
23-
- repo: https://github.com/PyCQA/isort
24-
rev: 5.12.0
25-
hooks:
26-
- id: isort
27-
exclude: ".*setup.py$"
28-
29-
- repo: https://github.com/PyCQA/flake8
30-
rev: 5.0.4
31-
hooks:
32-
- id: flake8
33-
additional_dependencies: [flake8-isort]
34-
exclude: ".*setup.py$"
25+
- id: ruff
26+
name: "Run ruff import sorter"
27+
args: ["--select=I", "--fix"]
28+
- id: ruff
29+
name: "Run ruff linter"
30+
- id: ruff-format
31+
name: "Run ruff formatter"
3532

3633
ci:
3734
autoupdate_schedule: weekly

0 commit comments

Comments
 (0)