Repository navigation
58 lines (49 loc) · 1.62 KB
/
Copy pathcicd.yml
File metadata and controls
58 lines (49 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: CI
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
workflow_dispatch:
jobs:
# ============================================================
# Job 1 -- Code Quality Checks (Python & Prettier)
# ============================================================
code_quality:
name: Code Quality Checks
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install Python formatters
run: |
python -m pip install --upgrade pip
python -m pip install autoflake black==25.11.0
- name: Check Python Code Quality
shell: bash
run: |
set -euo pipefail
echo "=== Running autoflake check ==="
autoflake --remove-all-unused-imports --remove-unused-variables --recursive --check .
echo "=== Running black check ==="
black . --check
- name: Set up Node.js 20
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Install Global Formatters
run: npm install -g prettier prettier-plugin-solidity
- name: Run Global Prettier Check
shell: bash
run: |
set -euo pipefail
NODE_GLOBAL=$(npm root -g)
echo "=== Running Prettier check ==="
prettier --plugin="$NODE_GLOBAL/prettier-plugin-solidity/dist/index.js" \
--check "**/*.{js,jsx,ts,tsx,json,html,css,md,sol,yml,yaml}"