๐ง Black Trigram (ํ๊ด) CI/CD Workflows
June 13, 2026 ยท View on GitHub
This document details the continuous integration and deployment workflows used in the Black Trigram project. The workflows automate testing, security scanning, and release procedures to ensure code quality and security compliance aligned with Hack23 AB's Secure Development Policy and Change Management standards.
Current TypeScript version: 6.0.3
Current Product Version: 0.7.33
Runner OS: ubuntu-26.04
Last Updated: 2026-06-13
๐ ISMS Policy Alignment
Black Trigram's CI/CD workflows implement security controls mandated by Hack23 AB's ISMS framework:
| ISMS Policy | Workflow Implementation |
|---|---|
| ๐ ๏ธ Secure Development Policy | SAST (CodeQL), SCA (Dependency Review), DAST (ZAP), performance testing |
| ๐ Change Management | Automated testing gates, security scanning, PR review requirements |
| ๐ Vulnerability Management | Dependabot, CodeQL, OSSF Scorecard, security advisories |
| ๐ Open Source Policy | SLSA attestations, SBOM generation, license compliance (FOSSA) |
| ๐ Information Security Policy | Security-hardened runners, SHA-pinned actions, least privilege permissions |
๐ Related Architecture Documentation
| Document | Focus | Description |
|---|---|---|
| System Architecture | ๐๏ธ Architecture | C4 model showing frontend-only Three.js (@react-three/fiber) + React architecture |
| Combat Architecture | โ๏ธ Game Design | Detailed combat system implementation with Korean martial arts integration |
| Game Design | ๐ฎ Game Design | Korean martial arts combat mechanics and player archetypes |
| Audio Assets | ๐ต Assets | Korean traditional instrument integration and combat audio |
| Art Assets | ๐จ Assets | Korean cyberpunk visual design and UI iconography |
| Future Architecture | ๐ฎ Future Vision | Planned features and scalability considerations |
| Development Guide | ๐ง Development | Security features, testing strategy, and development environment |
๐ Workflow Overview
The Black Trigram project uses GitHub Actions for automation with the following security-hardened workflows:
- ๐งช Test and Report - Comprehensive testing with unit tests and E2E tests
- ๐ Build, Attest and Release - Secure releases with SLSA attestations
- โ๏ธ AWS S3 Deployment - Automated deployment to CloudFront + S3 multi-region
- ๐ CodeQL Analysis - Security scanning for JavaScript/TypeScript vulnerabilities
- ๐ฆ Dependency Review - Vulnerability scanning for dependencies
- โญ Scorecard Analysis - OSSF security scorecard for supply chain security
- ๐ท๏ธ PR Labeler - Automated labeling for pull requests
- ๐ Setup Labels - Repository label management
- ๐ Lighthouse Performance - Performance auditing using budget.json
- ๐ท๏ธ ZAP Security Scan - Dynamic security testing of deployed application
- ๐ค Copilot Setup Steps - GitHub Copilot environment preparation with MCP servers
- โฟ Accessibility Test - WCAG 2.1 Level AA compliance validation
- ๐ฆ Audit Assets - Asset reference validation and integrity checking
- ๐ธ Screenshot Analysis - Automated UI/UX screenshot capture and analysis
- ๐งน Knip - Unused Code Detection - Static detection of unused files, exports, types, and dependencies on every PR
๐ Security Hardening Practices
Black Trigram implements industry best practices for securing CI/CD pipelines, with StepSecurity hardening for all workflows:
%%{init: {'theme':'base', 'themeVariables': {'primaryColor':'#2979FF','primaryTextColor':'#fff','primaryBorderColor':'#0D47A1','lineColor':'#00C853','secondaryColor':'#FFD600','tertiaryColor':'#FF3D00'}}}%%
flowchart LR
subgraph "๐ก๏ธ Pipeline Security Hardening"
PH[Permissions Hardening] --> LAP[Least Access Principle]
PS[Pin SHA Versions] --> IDT[Immutable Dependencies]
AV[Action Verification] --> TS[Trusted Sources]
RH[Runner Hardening] --> AL[Audit Logging]
OT[OIDC Tokens] --> EF[Ephemeral Credentials]
end
subgraph "๐ Security Measures"
AS[Asset Security] --> AC[Asset Verification]
DS[Dependency Security] --> PD[Dependency Pinning]
BS[Build Security] --> BA[Build Attestations]
RS[Release Security] --> SBOM[SBOM Generation]
end
PH --> AS
PS --> DS
AV --> BS
RH --> RS
classDef security fill:#e74c3c,stroke:#c0392b,stroke-width:1.5px,color:white
classDef measures fill:#9b59b6,stroke:#8e44ad,stroke-width:1.5px,color:white
class PH,PS,AV,RH,OT security
class AS,DS,BS,RS measures
Specific Hardening Measures
Every workflow in the Black Trigram project implements:
- ๐ Permissions Restriction: Explicit least-privilege permissions
- ๐ SHA Pinning: All actions pinned to specific SHA hashes
- ๐ก๏ธ Runner Hardening: StepSecurity harden-runner for audit logging
- ๐ SBOM Generation: Software Bill of Materials for transparency
- ๐ Build Attestations: Cryptographic proof of build integrity
- โฑ๏ธ Timeout Limits: Resource exhaustion prevention
- ๐ OIDC Tokens: Secure authentication without long-lived secrets
- ๐ฅ๏ธ Pinned Runner OS: All jobs run on
ubuntu-26.04(fixed version, notubuntu-latest)
๐๏ธ Cache Strategy
All workflows use a consistent, non-redundant caching strategy to maximize build speed while minimizing cache storage consumption.
Cache Action Version
All explicit caches use a single pinned version:
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
npm / Node Modules
actions/setup-node is configured with cache: "npm" in every job that installs Node dependencies. This uses GitHub's built-in npm cache keyed on package-lock.json and is the only npm cache mechanism used โ no additional actions/cache step for ~/.npm is added, which would create a redundant second cache entry for the same data.
Special Tool Caches
Explicit actions/cache steps are used only for build artifacts that setup-node does not cover:
| Cache | Path | Key pattern | Used in |
|---|---|---|---|
| Vite build cache | node_modules/.vite | v2-{OS}-vite-{lockfile-hash} | build-validation, release build |
| Cypress binary | ~/.cache/Cypress | v2-cypress-{OS}-{lockfile-hash} | e2e-tests, release prepare |
| Playwright browsers | ~/.cache/ms-playwright | v2-playwright-{OS}-{lockfile-hash} | screenshot-analysis |
| APT packages (Chrome) | /var/cache/apt/archives | v2-{OS}-apt-chrome-{workflow-hash} | e2e-tests, release prepare |
| APT packages (Playwright) | /var/cache/apt/archives | v2-{OS}-apt-playwright-{workflow-hash} | screenshot-analysis |
| APT packages (graphviz) | /var/cache/apt/archives | v2-{OS}-apt-graphviz-{workflow-hash} | report |
Important โ Vite cache ordering: The Vite build cache step is placed after
npm ci.npm cideletes and recreatesnode_modules, so any cache restored before it would be immediately discarded. By restoring afternpm ci, the cached.vitedirectory is placed into the freshly-creatednode_modules/and is available for the subsequent build step.
Cache Key Versioning
All cache keys are prefixed with v2-. Incrementing this prefix (e.g. to v3-) immediately expires every existing cache entry on the next run, without needing to manually delete caches via the GitHub UI. The old v1/unversioned entries expire naturally after 7 days of no access.
๐ก๏ธ Resilience Against External Registry Failures
Browser and system-package installations can hang or fail when third-party registries are slow or unavailable. The following measures are applied across all affected workflows:
apt-get Resilience
DEBIAN_FRONTEND=noninteractiveis set to prevent interactive prompts that cause indefinite hangs.-qqflag is used withapt-get updateto suppress unnecessary output.--no-install-recommendslimits the install surface and reduces download size.- All
apt-getinstall steps are wrapped in atimeout-minutes:step-level limit.
Chrome Installation Resilience
The deprecated apt-key add method (which reads from stdin and can block) is replaced with the modern signed-keyring approach:
# Modern method โ non-blocking, uses gpg directly
curl -fsSL --retry 3 --retry-delay 5 --connect-timeout 30 \
https://dl.google.com/linux/linux_signing_key.pub \
| sudo gpg --dearmor -o /usr/share/keyrings/google-chrome-keyring.gpg
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/google-chrome-keyring.gpg] \
https://dl.google.com/linux/chrome/deb/ stable main" \
| sudo tee /etc/apt/sources.list.d/google-chrome.list > /dev/null
curl is invoked with --retry 3 --retry-delay 5 --connect-timeout 30 so transient network failures are retried automatically.
Playwright Installation Resilience
npx playwright install chromium --with-deps is given a timeout-minutes: 20 step-level timeout so a slow CDN or broken download does not cause the entire job to hang indefinitely. The timeout is set to 20 minutes (not 10) because on a cache miss, Playwright must download Chromium (~200 MB) plus install OS-level dependencies via apt, which can exceed 10 minutes on slow CDN or congested GitHub Actions runners. The Playwright browser cache (~/.cache/ms-playwright) is restored before this step so a successful cache hit skips the download entirely.
๐งช Test and Report Workflow
The Test and Report workflow ensures comprehensive quality validation:
%%{init: {'theme':'base', 'themeVariables': {'primaryColor':'#2979FF','primaryTextColor':'#fff','primaryBorderColor':'#0D47A1','lineColor':'#00C853','secondaryColor':'#FFD600','tertiaryColor':'#FF3D00'}}}%%
flowchart TD
Start["๐ Code Push/PR"] --> Prepare["๐ง Prepare Environment"]
Prepare --> BuildVal["๐๏ธ Build Validation"]
Prepare --> UnitTests["๐งช Unit Tests"]
Prepare --> E2ETests["๐ E2E Tests"]
BuildVal --> BuildPass{"โ
Build Success?"}
UnitTests --> Coverage["๐ Coverage Report"]
E2ETests --> CypressArtifacts["๐ฌ Videos & Screenshots"]
BuildPass -->|Yes| TestResults["๐ Test Results"]
BuildPass -->|No| FailBuild["โ Fail Build"]
Coverage --> TestResults
CypressArtifacts --> TestResults
TestResults --> Report["๐ค Upload Reports"]
classDef startEnd fill:#3498db,stroke:#2980b9,stroke-width:2px,color:white
classDef process fill:#9b59b6,stroke:#8e44ad,stroke-width:1.5px,color:white
classDef test fill:#27ae60,stroke:#1e8449,stroke-width:1.5px,color:white
classDef decision fill:#f39c12,stroke:#e67e22,stroke-width:2px,color:black
classDef fail fill:#e74c3c,stroke:#c0392b,stroke-width:2px,color:white
class Start,Report startEnd
class Prepare,BuildVal,TestResults process
class UnitTests,E2ETests,Coverage,CypressArtifacts test
class BuildPass decision
class FailBuild fail
Testing Components
The comprehensive testing approach covers:
- ๐๏ธ Build Validation: Ensures application builds successfully
- ๐งช Unit Testing: Vitest with coverage reporting
- ๐ E2E Testing: Cypress with video recording and screenshots
- ๐ Test Reporting: JUnit XML and coverage reports
- ๐ฌ Artifact Collection: Test videos, screenshots, and reports
๐ Build, Attest and Release Workflow
The secure release workflow handles version management, build attestations, and deployment with SLSA compliance:
%%{init: {'theme':'base', 'themeVariables': {'primaryColor':'#2979FF','primaryTextColor':'#fff','primaryBorderColor':'#0D47A1','lineColor':'#00C853','secondaryColor':'#FFD600','tertiaryColor':'#FF3D00'}}}%%
flowchart TD
Trigger["๐ท๏ธ Release Trigger"] --> Prepare["๐ง Prepare Release"]
Prepare --> Build["๐๏ธ Build Package"]
Build --> Security["๐ Security Validation"]
Security --> SBOM["๐ Generate SBOM"]
SBOM --> Attestations["๐ Create Attestations"]
Attestations --> Release["๐ฆ Create Release"]
Release --> Deploy["๐ Deploy to Pages"]
Deploy --> Complete["โ
Release Complete"]
classDef trigger fill:#3498db,stroke:#2980b9,stroke-width:2px,color:white
classDef process fill:#9b59b6,stroke:#8e44ad,stroke-width:1.5px,color:white
classDef security fill:#e74c3c,stroke:#c0392b,stroke-width:1.5px,color:white
classDef deploy fill:#27ae60,stroke:#1e8449,stroke-width:1.5px,color:white
class Trigger,Complete trigger
class Prepare,Build,Release process
class Security,SBOM,Attestations security
class Deploy deploy
Release Management Features
- ๐ท๏ธ Tag-based Releases: Automatic releases on tag push
- ๐ Manual Releases: Workflow dispatch with version input
- ๐ Security Attestations: SLSA Level 3 build provenance
- ๐ SBOM Generation: Software Bill of Materials in SPDX format
- ๐ฆ Artifact Management: Built application with security attestations
- ๐ GitHub Pages: Automated deployment to GitHub Pages (DR)
โ๏ธ AWS S3 Deployment Workflow
The AWS deployment workflow handles automatic deployment to CloudFront + S3 multi-region infrastructure with disaster recovery failover to GitHub Pages.
%%{init: {'theme':'base', 'themeVariables': {'primaryColor':'#2979FF','primaryTextColor':'#fff','primaryBorderColor':'#0D47A1','lineColor':'#00C853','secondaryColor':'#FFD600','tertiaryColor':'#FF3D00'}}}%%
flowchart TD
Trigger["๐ Push to Main"] --> Prepare["๐ง Environment Setup"]
Prepare --> S3Deploy["๐พ Sync docs/ to S3 us-east-1"]
S3Deploy --> CacheHeaders["โก Set Cache Headers"]
CacheHeaders --> CFInvalidate["๐ Invalidate CloudFront"]
CFInvalidate --> Complete["โ
Deployment Complete"]
classDef trigger fill:#3498db,stroke:#2980b9,stroke-width:2px,color:white
classDef process fill:#9b59b6,stroke:#8e44ad,stroke-width:1.5px,color:white
classDef aws fill:#FF9900,stroke:#232F3E,stroke-width:1.5px,color:white
classDef complete fill:#27ae60,stroke:#1e8449,stroke-width:2px,color:white
class Trigger trigger
class Prepare process
class S3Deploy,CacheHeaders,CFInvalidate aws
class Complete complete
Note: GitHub Pages disaster recovery is deployed separately via release.yml on tagged releases, not as part of the main AWS deployment workflow.
AWS Deployment Features
- โ๏ธ CloudFront CDN: Global content delivery with edge caching
- ๐พ S3 Storage: Primary deployment to us-east-1 with S3 replication (if configured at infrastructure level)
- โก Cache Optimization: Aggressive caching for static assets (1 year)
- CSS/JS:
max-age=31536000, immutable - Images:
max-age=31536000, immutable - HTML:
max-age=3600, must-revalidate - Fonts:
max-age=31536000, immutable
- CSS/JS:
- ๐ CloudFront Invalidation: Automatic cache invalidation on deployment
- ๐ก Route53 Integration: DNS management with health checks
- ๐ AWS IAM: OIDC authentication with role-based access
- ๐ GitHub Pages DR: Deployed separately on tagged releases (via
release.yml) for disaster recovery - ๐ก๏ธ Security: StepSecurity harden-runner with egress policy
Deployment Architecture
The workflow deploys to a multi-tier infrastructure:
- Primary: CloudFront โ S3 (us-east-1)
- Disaster Recovery: GitHub Pages (release-based), activated via Route53 failover
AWS Credentials
The workflow uses AWS OIDC (OpenID Connect) for secure authentication:
- Role:
GithubWorkFlowRolein AWS IAM - Region:
us-east-1(primary) - S3 Bucket:
blacktrigram-frontend-us-east-1-172017021075 - CloudFormation Stack:
blacktrigram-frontend
๐ Security Analysis Workflows
Multiple security scanning workflows protect the application:
%%{init: {'theme':'base', 'themeVariables': {'primaryColor':'#2979FF','primaryTextColor':'#fff','primaryBorderColor':'#0D47A1','lineColor':'#00C853','secondaryColor':'#FFD600','tertiaryColor':'#FF3D00'}}}%%
flowchart LR
subgraph "๐ Static Security Analysis"
CodeQL["๐ CodeQL Analysis"]
Deps["๐ฆ Dependency Review"]
Score["โญ Scorecard Analysis"]
end
subgraph "๐ท๏ธ Dynamic Security Testing"
ZAP["๐ท๏ธ ZAP DAST Scan"]
Light["๐ Lighthouse Audit"]
end
subgraph "๐ Security Reporting"
SecTab["๐ก๏ธ GitHub Security Tab"]
Artifacts["๐ Security Artifacts"]
Badge["๐ Security Badge"]
end
CodeQL --> SecTab
Deps --> SecTab
Score --> Badge
ZAP --> Artifacts
Light --> Artifacts
classDef static fill:#9b59b6,stroke:#8e44ad,stroke-width:1.5px,color:white
classDef dynamic fill:#e67e22,stroke:#d35400,stroke-width:1.5px,color:white
classDef report fill:#27ae60,stroke:#1e8449,stroke-width:1.5px,color:white
class CodeQL,Deps,Score static
class ZAP,Light dynamic
class SecTab,Artifacts,Badge report
๐ CodeQL Analysis
Comprehensive static analysis for JavaScript/TypeScript vulnerabilities:
- ๐จ Vulnerability Detection: Identifies security issues in code
- ๐ Weekly Scanning: Scheduled analysis for continuous monitoring
- ๐ SARIF Reports: Results uploaded to GitHub Security tab
๐ฆ Dependency Review
Automated scanning for dependency vulnerabilities:
- โ ๏ธ CVE Detection: Identifies known vulnerabilities in dependencies
- ๐ PR Comments: Automatic comments on pull requests with findings
- ๐ซ Blocking: Can block merges with vulnerable dependencies
โญ OSSF Scorecard
Supply chain security assessment:
- ๐ Security Score: Public transparency with security badge
- ๐ฆ Dependency Management: Checks for pinned versions and updates
- ๐ Code Signing: Validates commit signing and release integrity
- ๐ก๏ธ Branch Protection: Verifies branch protection settings
๐ท๏ธ Automated Labeling System
Intelligent pull request labeling for development workflows:
%%{init: {'theme':'base', 'themeVariables': {'primaryColor':'#2979FF','primaryTextColor':'#fff','primaryBorderColor':'#0D47A1','lineColor':'#00C853','secondaryColor':'#FFD600','tertiaryColor':'#FF3D00'}}}%%
flowchart TD
PR["๐ Pull Request"] --> Analysis["๐ File Analysis"]
Analysis --> Labels{"๐ท๏ธ Label Categories"}
Labels --> Feature["๐ Features & Enhancements"]
Labels --> Bug["๐ Bug Fixes"]
Labels --> Docs["๐ Documentation"]
Labels --> Security["๐ Security"]
Labels --> Testing["๐งช Testing"]
Labels --> Deps["๐ฆ Dependencies"]
Feature --> Apply["๐ท๏ธ Apply Labels"]
Bug --> Apply
Docs --> Apply
Security --> Apply
Testing --> Apply
Deps --> Apply
classDef pr fill:#3498db,stroke:#2980b9,stroke-width:2px,color:white
classDef analysis fill:#9b59b6,stroke:#8e44ad,stroke-width:1.5px,color:white
classDef decision fill:#f39c12,stroke:#e67e22,stroke-width:1.5px,color:black
classDef labels fill:#27ae60,stroke:#1e8449,stroke-width:1.5px,color:white
classDef apply fill:#e67e22,stroke:#d35400,stroke-width:2px,color:white
class PR pr
class Analysis analysis
class Labels decision
class Feature,Bug,Docs,Security,Testing,Deps labels
class Apply apply
Label Categories
The labeler automatically applies labels based on file changes:
- ๐ feature - New features and enhancements
- ๐ bug - Bug fixes and patches
- ๐ documentation - Documentation updates
- ๐ security - Security improvements and fixes
- ๐งช testing - Test improvements and coverage
- ๐ฆ dependencies - Dependency updates
- ๐จ ui - User interface changes
- ๐๏ธ infrastructure - Build and CI/CD changes
๐ Performance Monitoring
Lighthouse performance auditing using the budget.json configuration:
%%{init: {'theme':'base', 'themeVariables': {'primaryColor':'#2979FF','primaryTextColor':'#fff','primaryBorderColor':'#0D47A1','lineColor':'#00C853','secondaryColor':'#FFD600','tertiaryColor':'#FF3D00'}}}%%
flowchart TD
Deploy["๐ Deployment"] --> Lighthouse["๐ Lighthouse Audit"]
Lighthouse --> Performance["โก Performance Metrics"]
Lighthouse --> Budget["๐ Budget Validation"]
Performance --> Metrics["๐ Core Web Vitals"]
Budget --> Limits["โ ๏ธ Budget Limits"]
Metrics --> Report["๐ Performance Report"]
Limits --> Report
classDef deploy fill:#27ae60,stroke:#1e8449,stroke-width:2px,color:white
classDef audit fill:#f39c12,stroke:#e67e22,stroke-width:1.5px,color:black
classDef metrics fill:#9b59b6,stroke:#8e44ad,stroke-width:1.5px,color:white
classDef report fill:#3498db,stroke:#2980b9,stroke-width:2px,color:white
class Deploy deploy
class Lighthouse audit
class Performance,Budget,Metrics,Limits metrics
class Report report
Performance Budget (budget.json)
The Lighthouse workflow tests against specific performance budgets:
- โก Interactive: 6000ms budget
- ๐จ First Contentful Paint: 3500ms budget
- ๐ Largest Contentful Paint: 4000ms budget
- โฑ๏ธ Total Blocking Time: 1600ms budget
- ๐ Cumulative Layout Shift: 0.1 budget
- ๐ Speed Index: 5000ms budget
Resource Budgets
- ๐ Scripts: 180KB budget
- ๐ผ๏ธ Images: 200KB budget
- ๐จ Stylesheets: 50KB budget
- ๐ Document: 20KB budget
- ๐ค Fonts: 50KB budget
- ๐ฆ Total: 500KB budget
๐ท๏ธ Dynamic Security Testing
ZAP security scanning of the deployed application:
%%{init: {'theme':'base', 'themeVariables': {'primaryColor':'#2979FF','primaryTextColor':'#fff','primaryBorderColor':'#0D47A1','lineColor':'#00C853','secondaryColor':'#FFD600','tertiaryColor':'#FF3D00'}}}%%
flowchart TD
Deployed["๐ Deployed Application"] --> ZAP["๐ท๏ธ ZAP Security Scan"]
ZAP --> WebVulns["๐ Web Vulnerabilities"]
ZAP --> OWASP["๐ก๏ธ OWASP Top 10"]
WebVulns --> SecurityReport["๐ Security Report"]
OWASP --> SecurityReport
classDef deployed fill:#27ae60,stroke:#1e8449,stroke-width:2px,color:white
classDef scan fill:#e74c3c,stroke:#c0392b,stroke-width:1.5px,color:white
classDef vuln fill:#9b59b6,stroke:#8e44ad,stroke-width:1.5px,color:white
classDef report fill:#3498db,stroke:#2980b9,stroke-width:2px,color:white
class Deployed deployed
class ZAP scan
class WebVulns,OWASP vuln
class SecurityReport report
Security Testing Focus
- ๐ Vulnerability Scanning: OWASP ZAP full scan of deployed application
- ๐ก๏ธ OWASP Top 10: Testing against common web vulnerabilities
- ๐ Dynamic Testing: Live application security assessment
- ๐ Issue Creation: Optional GitHub issue creation for vulnerabilities
๐ค Copilot Setup Steps Workflow
GitHub Copilot environment preparation with Model Context Protocol (MCP) servers:
%%{init: {'theme':'base', 'themeVariables': {'primaryColor':'#2979FF','primaryTextColor':'#fff','primaryBorderColor':'#0D47A1','lineColor':'#00C853','secondaryColor':'#FFD600','tertiaryColor':'#FF3D00'}}}%%
flowchart TD
Trigger["๐ Workflow Trigger"] --> Setup["๐ง Environment Setup"]
Setup --> Chrome["๐ Chrome Installation"]
Setup --> Node["๐ฆ Node.js 26"]
Setup --> ThreeJS["๐ฎ Three.js Test Environment"]
Chrome --> WebGL["๐จ WebGL Support"]
Node --> Dependencies["๐ฆ npm ci"]
ThreeJS --> Xvfb["๐ฅ๏ธ Xvfb Display Server"]
WebGL --> Cypress["๐งช Cypress Verification"]
Dependencies --> Cypress
Xvfb --> Cypress
Cypress --> Ready["โ
Copilot Ready"]
classDef trigger fill:#3498db,stroke:#2980b9,stroke-width:2px,color:white
classDef setup fill:#9b59b6,stroke:#8e44ad,stroke-width:1.5px,color:white
classDef install fill:#27ae60,stroke:#1e8449,stroke-width:1.5px,color:white
classDef ready fill:#f39c12,stroke:#e67e22,stroke-width:2px,color:black
class Trigger trigger
class Setup,Node,Chrome,ThreeJS setup
class WebGL,Dependencies,Xvfb,Cypress install
class Ready ready
Copilot Environment Features
- ๐ Complete Three.js Test Environment: Chrome with WebGL, Xvfb for headless rendering
- ๐ฆ Node.js 26: Active CI baseline with npm caching for faster builds
- ๐ฎ Gaming Test Infrastructure: Fonts, graphics libraries, Korean language support
- ๐ง MCP Server Integration: GitHub, filesystem, git, memory, sequential-thinking, playwright servers
- ๐ Security Hardening: StepSecurity harden-runner with egress policy auditing
- ๐ Environment Validation: Comprehensive display of setup status and version info
- โก Performance Optimized: APT package caching, dependency caching, build artifact caching
MCP Servers Available
The workflow sets up the following MCP servers for enhanced Copilot capabilities:
- github: Repository data, issues, PRs, workflows (with PAT for cross-repo access)
- filesystem: Secure filesystem access for reading/editing project files
- git: Git operations and repository history context
- memory: Conversation history and context between agent sessions
- sequential-thinking: Step-by-step problem-solving capabilities
- playwright: Browser automation for testing and debugging (enabled)
- brave-search: Documentation search (disabled by default)
- aws: AWS infrastructure operations (disabled by default)
โฟ Accessibility Testing Workflow
WCAG 2.1 Level AA compliance validation for Korean-English bilingual UI:
%%{init: {'theme':'base', 'themeVariables': {'primaryColor':'#2979FF','primaryTextColor':'#fff','primaryBorderColor':'#0D47A1','lineColor':'#00C853','secondaryColor':'#FFD600','tertiaryColor':'#FF3D00'}}}%%
flowchart TD
Trigger["๐ PR/Push Trigger"] --> AxeTests["โฟ axe-core Tests"]
Trigger --> ColorTests["๐จ Color Contrast Tests"]
AxeTests --> ARIAValidation["๐ท๏ธ ARIA Labels"]
AxeTests --> KeyboardNav["โจ๏ธ Keyboard Navigation"]
AxeTests --> FocusIndicators["๐ Focus Indicators"]
ColorTests --> TextContrast["๐ Text Contrast 4.5:1"]
ColorTests --> UIContrast["๐จ UI Contrast 3:1"]
ARIAValidation --> Report["๐ Accessibility Report"]
KeyboardNav --> Report
FocusIndicators --> Report
TextContrast --> Report
UIContrast --> Report
Report --> PRComment["๐ฌ PR Comment"]
Report --> Artifacts["๐ฆ Upload Artifacts"]
classDef trigger fill:#3498db,stroke:#2980b9,stroke-width:2px,color:white
classDef test fill:#9b59b6,stroke:#8e44ad,stroke-width:1.5px,color:white
classDef validation fill:#27ae60,stroke:#1e8449,stroke-width:1.5px,color:white
classDef report fill:#f39c12,stroke:#e67e22,stroke-width:2px,color:black
class Trigger trigger
class AxeTests,ColorTests test
class ARIAValidation,KeyboardNav,FocusIndicators,TextContrast,UIContrast validation
class Report,PRComment,Artifacts report
Accessibility Standards
Black Trigram implements comprehensive accessibility testing for inclusive gaming:
- โฟ WCAG 2.1 Level AA Compliance: Full conformance with international accessibility standards
- ๐จ Color Contrast: 4.5:1 for text, 3:1 for UI components on Korean cyberpunk theme
- โจ๏ธ Keyboard Navigation: Full game control without mouse (WASD, 1-8 stances, Space, B, V)
- ๐ท๏ธ Bilingual ARIA: Korean-English labels for all interactive elements
- ๐ Focus Management: Visible focus indicators meeting 3:1 contrast
- ๐ฎ Gaming-Specific: Dialog semantics, progress bars, timers with proper ARIA roles
Components Tested
- VirtualDPad: Mobile touch controls with button groups
- StanceWheel: Eight trigram stance selector with radiogroup semantics
- PauseMenu: Dialog with escape key and modal behavior
- HealthBar/StaminaBar: Progress bars with live regions
- CombatTimer: Timer with countdown announcements
- BilingualText: Korean-English dual labels with proper language tagging
๐ฆ Asset Audit Workflow
Automated validation of asset references and integrity:
%%{init: {'theme':'base', 'themeVariables': {'primaryColor':'#2979FF','primaryTextColor':'#fff','primaryBorderColor':'#0D47A1','lineColor':'#00C853','secondaryColor':'#FFD600','tertiaryColor':'#FF3D00'}}}%%
flowchart TD
Trigger["๐ Code/Asset Changes"] --> Audit["๐ Asset Audit Script"]
Audit --> Images["๐ผ๏ธ Image References"]
Audit --> Audio["๐ต Audio Files"]
Audit --> Fonts["๐ค Font Files"]
Images --> Validate["โ
Validate Existence"]
Audio --> Validate
Fonts --> Validate
Validate --> Pass{All Valid?}
Pass -->|Yes| Success["โ
Audit Passed"]
Pass -->|No| PRComment["โ PR Comment with Missing Assets"]
Success --> Complete["๐ Complete"]
PRComment --> Fail["โ Workflow Failed"]
classDef trigger fill:#3498db,stroke:#2980b9,stroke-width:2px,color:white
classDef audit fill:#9b59b6,stroke:#8e44ad,stroke-width:1.5px,color:white
classDef check fill:#27ae60,stroke:#1e8449,stroke-width:1.5px,color:white
classDef decision fill:#f39c12,stroke:#e67e22,stroke-width:2px,color:black
classDef fail fill:#e74c3c,stroke:#c0392b,stroke-width:2px,color:white
class Trigger trigger
class Audit,Images,Audio,Fonts audit
class Validate,Success,Complete check
class Pass decision
class PRComment,Fail fail
Asset Validation Features
- ๐ผ๏ธ Image References: Validates all image imports and public asset references
- ๐ต Audio Files: Checks audio file existence for Howler.js integration
- ๐ค Font Files: Validates Korean and English font availability
- ๐ฆ Dependency Tracking: Ensures assets match code references
- ๐ Automated Detection: Runs on code and asset changes
- ๐ฌ PR Feedback: Automatic comments on pull requests for missing assets
๐ธ Screenshot Analysis Workflow
Automated UI/UX screenshot capture for visual regression and documentation:
%%{init: {'theme':'base', 'themeVariables': {'primaryColor':'#2979FF','primaryTextColor':'#fff','primaryBorderColor':'#0D47A1','lineColor':'#00C853','secondaryColor':'#FFD600','tertiaryColor':'#FF3D00'}}}%%
flowchart TD
Trigger["๐ PR Trigger"] --> SetupEnv["๐ง Playwright Setup"]
SetupEnv --> BuildApp["๐๏ธ Build Application"]
BuildApp --> Xvfb["๐ฅ๏ธ Start Xvfb Display"]
Xvfb --> CaptureIntro["๐ธ Capture IntroScreen"]
CaptureIntro --> CaptureCombat["๐ธ Capture CombatScreen"]
CaptureCombat --> CaptureSettings["๐ธ Capture SettingsScreen"]
CaptureSettings --> Upload["๐ฆ Upload Artifacts"]
Upload --> PostPR["๐ฌ Post to PR"]
classDef trigger fill:#3498db,stroke:#2980b9,stroke-width:2px,color:white
classDef setup fill:#9b59b6,stroke:#8e44ad,stroke-width:1.5px,color:white
classDef capture fill:#27ae60,stroke:#1e8449,stroke-width:1.5px,color:white
classDef output fill:#f39c12,stroke:#e67e22,stroke-width:2px,color:black
class Trigger trigger
class SetupEnv,BuildApp,Xvfb setup
class CaptureIntro,CaptureCombat,CaptureSettings capture
class Upload,PostPR output
Screenshot Capabilities
- ๐ธ Automated Capture: Playwright-based screenshot generation for all game screens
- ๐ฎ Three.js Rendering: WebGL rendering with SwiftShader in headless environment
- ๐ฅ๏ธ Multiple Resolutions: Desktop (1280x1024) and mobile (375x667) screenshots
- ๐จ Visual Documentation: Automatic UI/UX documentation for PRs
- ๐ Retention: 30-day artifact retention for comparison
- ๐ฐ๐ท Korean UI: Captures bilingual Korean-English interface elements
- ๐ PR Integration: Posts screenshots directly to pull request for review
๐งน Knip - Unused Code Detection
Automated detection of unused files, exports, types, and dependencies on every pull request:
%%{init: {'theme':'base', 'themeVariables': {'primaryColor':'#2979FF','primaryTextColor':'#fff','primaryBorderColor':'#0D47A1','lineColor':'#00C853','secondaryColor':'#FFD600','tertiaryColor':'#FF3D00'}}}%%
flowchart TD
Trigger["๐ PR Trigger"] --> Setup["๐ง Node.js Setup"]
Setup --> Install["๐ฆ npm ci"]
Install --> KnipText["๐งน Run Knip - text report"]
Install --> KnipJson["๐ Run Knip - JSON report"]
KnipText --> Summary["๐ Job Summary Table"]
KnipJson --> Summary
Summary --> Artifact["๐ฆ Upload knip-report artifact"]
Artifact --> Status["โ
/โ ๏ธ Notice or Warning"]
classDef trigger fill:#3498db,stroke:#2980b9,stroke-width:2px,color:white
classDef step fill:#9b59b6,stroke:#8e44ad,stroke-width:1.5px,color:white
classDef report fill:#27ae60,stroke:#1e8449,stroke-width:1.5px,color:white
classDef output fill:#f39c12,stroke:#e67e22,stroke-width:2px,color:black
class Trigger trigger
class Setup,Install step
class KnipText,KnipJson,Summary report
class Artifact,Status output
Knip Capabilities
- ๐๏ธ Unused Files: Source files not reachable from any entry point
- ๐ค Unused Exports: Exported symbols never imported elsewhere
- ๐ค Unused Types & Enum Members: Type aliases, interfaces, and enum members with no consumers
- โป๏ธ Duplicate Exports: Symbols exported multiple times (e.g. named + default)
- ๐ฆ Unused Dependencies:
dependencies/devDependenciesdeclared inpackage.jsonbut never imported - ๐ Unlisted Dependencies: Imports not declared in
package.json - ๐ Job Summary: Markdown table summarising counts per category, posted to the GitHub Actions run summary
- ๐ Artifact Retention: 14-day retention of
knip-report.txtandknip-report.jsonfor review - โ ๏ธ Advisory Mode: Surfaces findings as warnings without blocking PRs while the codebase is being cleaned up; promote to a hard gate once findings are at zero
Knip Configuration (knip.json)
The project uses a comprehensive knip.json that covers:
- Application entry points:
src/main.tsx,src/index.ts, all public library subpath entries (src/audio/index.ts,src/systems/*/index.ts,src/components/**/index.ts, etc.) - Build & tool configs:
vite.config.ts,vite.lib.config.ts,vitest.config.ts,cypress.config.ts,eslint.config.js,vite-plugins/**/*.ts,generate-sitemaps.js - Automation scripts:
scripts/**/*.{ts,js,cjs,mjs}(audits, asset generation, screenshot capture, validation โ invoked frompackage.jsonscripts and CI workflows) - Cypress entries:
cypress.config.ts,cypress/e2e/**/*.{spec,cy}.{ts,tsx},cypress/support/**/*.ts,cypress/plugins/**/*.{ts,js} - Test files:
src/**/*.{test,spec}.{ts,tsx},src/**/__tests__/**/*.{ts,tsx},src/test/setup.ts - Plugin integration: TypeScript (
tsconfig*.json), Vite, Vitest, Cypress, ESLint plugin configs are wired up so knip understands their conventions - Ignored dependencies: Reporters and peer-dep adapters that aren't imported directly (
mochawesome*,cypress-junit-reporter,vite-bundle-analyzer,typedoc-plugin-*,postprocessingpeer)
Local Usage
Developers can run knip locally before pushing:
npm run knip # full report
npm run find:unused # alias for npm run knip
npm run knip -- --reporter json > knip-report.json
Workflow Integration & Dependencies
The complete CI/CD pipeline shows how all workflows interact:
%%{init: {'theme':'base', 'themeVariables': {'primaryColor':'#2979FF','primaryTextColor':'#fff','primaryBorderColor':'#0D47A1','lineColor':'#00C853','secondaryColor':'#FFD600','tertiaryColor':'#FF3D00'}}}%%
flowchart TB
subgraph "๐ Continuous Integration"
PR["๐ Pull Request"] --> TestReport["๐งช Test & Report"]
PR --> DepReview["๐ฆ Dependency Review"]
PR --> Labeler["๐ท๏ธ PR Labeler"]
PR --> A11yTest["โฟ Accessibility Test"]
PR --> AssetAudit["๐ฆ Asset Audit"]
PR --> Screenshots["๐ธ Screenshot Analysis"]
PR --> Knip["๐งน Knip Unused Code"]
TestReport --> CodeQL["๐ CodeQL Analysis"]
end
subgraph "๐ Continuous Deployment"
Release["๐ท๏ธ Release Trigger"] --> Build["๐๏ธ Build & Attest"]
Build --> ReleaseDeploy["๐ฆ Release Artifacts"]
Build --> GHPagesDeploy["๐ Deploy to GitHub Pages DR"]
Main["๐ Main Branch"] --> AWSDeployTrigger["โ๏ธ AWS Deploy Trigger"]
AWSDeployTrigger --> S3Deploy["๐พ Deploy to S3 + CloudFront"]
S3Deploy --> Lighthouse["๐ Lighthouse Audit"]
S3Deploy --> ZAPScan["๐ท๏ธ ZAP Security Scan"]
end
subgraph "๐ Continuous Monitoring"
Schedule["โฐ Scheduled"] --> Scorecard["โญ Scorecard Analysis"]
Schedule --> CodeQLScheduled["๐ CodeQL Weekly"]
end
subgraph "๐ค Developer Experience"
CopilotTrigger["๐ง Copilot Setup"] --> CopilotEnv["๐ค MCP Servers & Environment"]
CopilotEnv --> AgentReady["โ
Agent Ready"]
end
subgraph "๐ ๏ธ Repository Management"
LabelSetup["๐ Setup Labels"] --> LabelsReady["โ
Labels Created"]
LabelsReady -.->|enables| Labeler
end
PR -.->|"approved & merged"| Main
Main --> CodeQL
Main -.->|"tag created"| Release
classDef integration fill:#a0c8e0,stroke:#2980b9,stroke-width:1.5px,color:black
classDef deployment fill:#86b5d9,stroke:#27ae60,stroke-width:1.5px,color:black
classDef aws fill:#FF9900,stroke:#232F3E,stroke-width:1.5px,color:white
classDef monitoring fill:#d1c4e9,stroke:#8e44ad,stroke-width:1.5px,color:black
classDef trigger fill:#bbdefb,stroke:#e67e22,stroke-width:1.5px,color:black
classDef devex fill:#ffccbc,stroke:#ff5722,stroke-width:1.5px,color:black
classDef repo fill:#c5e1a5,stroke:#689f38,stroke-width:1.5px,color:black
class PR,TestReport,DepReview,Labeler,CodeQL,A11yTest,AssetAudit,Screenshots,Knip integration
class Release,Build,ReleaseDeploy,Lighthouse,ZAPScan deployment
class AWSDeployTrigger,AWSBuild,S3Deploy,GHPagesDeploy aws
class Schedule,Scorecard,CodeQLScheduled monitoring
class Main trigger
class CopilotTrigger,CopilotEnv,AgentReady devex
class LabelSetup,LabelsReady repo
๐ Security Compliance
OSSF Scorecard Integration
- Automated scoring of supply chain security practices
- Public transparency with security badge
- Continuous monitoring of security posture
Supply Chain Protection
- Pinned dependencies - All GitHub Actions pinned to SHA hashes
- Dependency scanning - Automated vulnerability detection
- SLSA compliance - Build integrity and provenance
- Signed artifacts - Cryptographic verification of releases
Build Attestations
Every release includes:
- ๐ SBOM: Software Bill of Materials in SPDX format
- ๐ Build Provenance: SLSA-compliant attestations
- ๐ Artifact Signing: Cryptographic signatures
- โ Verification: GitHub CLI verification commands
ํ๊ด์ ๊ธธ์ ๊ฑธ์ด๋ผ - Walk the Path of the Black Trigram
The CI/CD workflows ensure that every aspect of the application meets the highest standards of quality, security, and reliability through automated testing, security scanning, and secure release management.
๐ Related Documents
๐ ISMS Policies
- ๐ ๏ธ Secure Development Policy - Security-integrated SDLC standards
- ๐ Change Management - Risk-controlled change processes
- ๐ Vulnerability Management - Security testing procedures
- ๐ Open Source Policy - Open source governance and licensing
- ๐ Information Security Policy - Overall security governance
๐ก๏ธ Black Trigram Security Documentation
- ๐ก๏ธ Security Architecture - Current security implementation
- ๐ฏ Threat Model - STRIDE analysis and attack trees
- ๐ Security Policy - Vulnerability reporting
- ๐บ๏ธ ISMS Reference Mapping - Complete ISMS policy mapping
๐ง Development Documentation
- ๐ง Development Guide - Security features and testing strategy
- ๐ Architecture - Overall system design
- โ๏ธ Combat Architecture - Combat system implementation
- ๐งช Unit Test Plan - Unit testing strategy
- ๐ฏ E2E Test Plan - End-to-end testing documentation
๐ Document Control:
โ
Approved by: James Pether Sรถrling, CEO
๐ค Distribution: Public
๐ท๏ธ Classification:
๐
Effective Date: 2026-04-28
โฐ Next Review: 2026-10-28
๐ฏ Framework Compliance: