mirror of
https://github.com/pezkuwichain/pwap.git
synced 2026-06-12 20:11:03 +00:00
Add unified build scripts and update Quality Gate workflow for all packages
This commit is contained in:
@@ -9,10 +9,10 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
# ========================================
|
# ========================================
|
||||||
# BUILD, LINT & TEST (CRITICAL)
|
# WEB APP - BUILD, LINT & TEST
|
||||||
# ========================================
|
# ========================================
|
||||||
quality-gate:
|
web:
|
||||||
name: Build, Lint & Test
|
name: Web App
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@@ -34,9 +34,9 @@ jobs:
|
|||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: web/node_modules
|
path: web/node_modules
|
||||||
key: ${{ runner.os }}-node-${{ hashFiles('web/package-lock.json') }}
|
key: ${{ runner.os }}-web-${{ hashFiles('web/package-lock.json') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-node-
|
${{ runner.os }}-web-
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
working-directory: ./web
|
working-directory: ./web
|
||||||
@@ -55,12 +55,11 @@ jobs:
|
|||||||
run: npm run build
|
run: npm run build
|
||||||
|
|
||||||
# ========================================
|
# ========================================
|
||||||
# SECURITY CHECKS (INFORMATIVE)
|
# MOBILE APP - LINT & TEST
|
||||||
# ========================================
|
# ========================================
|
||||||
security-audit:
|
mobile:
|
||||||
name: Security Audit
|
name: Mobile App
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: quality-gate
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
@@ -74,23 +73,94 @@ jobs:
|
|||||||
- name: Cache npm dependencies
|
- name: Cache npm dependencies
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: web/node_modules
|
path: mobile/node_modules
|
||||||
key: ${{ runner.os }}-node-${{ hashFiles('web/package-lock.json') }}
|
key: ${{ runner.os }}-mobile-${{ hashFiles('mobile/package-lock.json') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-node-
|
${{ runner.os }}-mobile-
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
working-directory: ./web
|
working-directory: ./mobile
|
||||||
run: npm install
|
run: npm install
|
||||||
|
|
||||||
- name: Run npm audit
|
- name: Run Linter
|
||||||
|
working-directory: ./mobile
|
||||||
|
run: npm run lint
|
||||||
|
|
||||||
|
- name: Run Tests
|
||||||
|
working-directory: ./mobile
|
||||||
|
run: npm run test
|
||||||
|
|
||||||
|
# ========================================
|
||||||
|
# SDK UI - BUILD & TEST
|
||||||
|
# ========================================
|
||||||
|
sdk-ui:
|
||||||
|
name: SDK UI
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup Node.js
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: '20'
|
||||||
|
|
||||||
|
- name: Enable Corepack
|
||||||
|
run: corepack enable
|
||||||
|
|
||||||
|
- name: Cache yarn dependencies
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
pezkuwi-sdk-ui/.yarn/cache
|
||||||
|
pezkuwi-sdk-ui/node_modules
|
||||||
|
key: ${{ runner.os }}-sdk-ui-${{ hashFiles('pezkuwi-sdk-ui/yarn.lock') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-sdk-ui-
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
working-directory: ./pezkuwi-sdk-ui
|
||||||
|
run: yarn install
|
||||||
|
|
||||||
|
- name: Build Project
|
||||||
|
working-directory: ./pezkuwi-sdk-ui
|
||||||
|
run: yarn build
|
||||||
|
|
||||||
|
# ========================================
|
||||||
|
# SECURITY CHECKS (INFORMATIVE)
|
||||||
|
# ========================================
|
||||||
|
security-audit:
|
||||||
|
name: Security Audit
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: [web, mobile, sdk-ui]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup Node.js
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: '20'
|
||||||
|
|
||||||
|
- name: Web - npm audit
|
||||||
working-directory: ./web
|
working-directory: ./web
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
run: npm audit --audit-level=high
|
run: |
|
||||||
|
npm install
|
||||||
|
npm audit --audit-level=high
|
||||||
|
|
||||||
|
- name: Mobile - npm audit
|
||||||
|
working-directory: ./mobile
|
||||||
|
continue-on-error: true
|
||||||
|
run: |
|
||||||
|
npm install
|
||||||
|
npm audit --audit-level=high
|
||||||
|
|
||||||
- name: TruffleHog Secret Scan
|
- name: TruffleHog Secret Scan
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
uses: trufflesecurity/trufflehog@main
|
uses: trufflesecurity/trufflehog@main
|
||||||
with:
|
with:
|
||||||
path: ./
|
path: ./
|
||||||
extra_args: --only-verified
|
extra_args: --only-verified
|
||||||
|
|||||||
@@ -0,0 +1,39 @@
|
|||||||
|
{
|
||||||
|
"name": "pwap",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"private": true,
|
||||||
|
"description": "Pezkuwi Web App Projects - Monorepo for web, mobile, and SDK UI applications",
|
||||||
|
"scripts": {
|
||||||
|
"build": "npm run build:web && npm run build:sdk-ui",
|
||||||
|
"build:web": "cd web && npm install && npm run build",
|
||||||
|
"build:sdk-ui": "cd pezkuwi-sdk-ui && yarn install && yarn build",
|
||||||
|
"build:all": "npm run build:web && npm run build:sdk-ui && npm run test:mobile",
|
||||||
|
"dev:web": "cd web && npm run dev",
|
||||||
|
"dev:mobile": "cd mobile && npm run dev",
|
||||||
|
"dev:sdk-ui": "cd pezkuwi-sdk-ui && yarn start",
|
||||||
|
"lint": "npm run lint:web && npm run lint:mobile",
|
||||||
|
"lint:web": "cd web && npm run lint",
|
||||||
|
"lint:mobile": "cd mobile && npm run lint",
|
||||||
|
"lint:sdk-ui": "cd pezkuwi-sdk-ui && yarn lint",
|
||||||
|
"test": "npm run test:web && npm run test:mobile",
|
||||||
|
"test:web": "cd web && npm run test",
|
||||||
|
"test:mobile": "cd mobile && npm run test",
|
||||||
|
"test:sdk-ui": "cd pezkuwi-sdk-ui && yarn test",
|
||||||
|
"install:all": "npm run install:web && npm run install:mobile && npm run install:sdk-ui",
|
||||||
|
"install:web": "cd web && npm install",
|
||||||
|
"install:mobile": "cd mobile && npm install",
|
||||||
|
"install:sdk-ui": "cd pezkuwi-sdk-ui && yarn install",
|
||||||
|
"clean": "npm run clean:web && npm run clean:mobile && npm run clean:sdk-ui",
|
||||||
|
"clean:web": "cd web && rm -rf node_modules dist",
|
||||||
|
"clean:mobile": "cd mobile && rm -rf node_modules",
|
||||||
|
"clean:sdk-ui": "cd pezkuwi-sdk-ui && yarn clean && rm -rf node_modules"
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/pezkuwichain/pwap.git"
|
||||||
|
},
|
||||||
|
"license": "Apache-2.0",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user