@hivehub/rulebook 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +191 -0
- package/README.md +539 -0
- package/dist/agents/claude-code.d.ts +69 -0
- package/dist/agents/claude-code.d.ts.map +1 -0
- package/dist/agents/claude-code.js +180 -0
- package/dist/agents/claude-code.js.map +1 -0
- package/dist/agents/cursor-agent.d.ts +184 -0
- package/dist/agents/cursor-agent.d.ts.map +1 -0
- package/dist/agents/cursor-agent.js +299 -0
- package/dist/agents/cursor-agent.js.map +1 -0
- package/dist/agents/gemini-cli.d.ts +69 -0
- package/dist/agents/gemini-cli.d.ts.map +1 -0
- package/dist/agents/gemini-cli.js +180 -0
- package/dist/agents/gemini-cli.js.map +1 -0
- package/dist/cli/commands.d.ts +57 -0
- package/dist/cli/commands.d.ts.map +1 -0
- package/dist/cli/commands.js +1370 -0
- package/dist/cli/commands.js.map +1 -0
- package/dist/cli/docs-prompts.d.ts +3 -0
- package/dist/cli/docs-prompts.d.ts.map +1 -0
- package/dist/cli/docs-prompts.js +45 -0
- package/dist/cli/docs-prompts.js.map +1 -0
- package/dist/cli/prompts.d.ts +6 -0
- package/dist/cli/prompts.d.ts.map +1 -0
- package/dist/cli/prompts.js +376 -0
- package/dist/cli/prompts.js.map +1 -0
- package/dist/core/agent-manager.d.ts +89 -0
- package/dist/core/agent-manager.d.ts.map +1 -0
- package/dist/core/agent-manager.js +546 -0
- package/dist/core/agent-manager.js.map +1 -0
- package/dist/core/auto-fixer.d.ts +14 -0
- package/dist/core/auto-fixer.d.ts.map +1 -0
- package/dist/core/auto-fixer.js +207 -0
- package/dist/core/auto-fixer.js.map +1 -0
- package/dist/core/changelog-generator.d.ts +44 -0
- package/dist/core/changelog-generator.d.ts.map +1 -0
- package/dist/core/changelog-generator.js +222 -0
- package/dist/core/changelog-generator.js.map +1 -0
- package/dist/core/cli-bridge.d.ts +113 -0
- package/dist/core/cli-bridge.d.ts.map +1 -0
- package/dist/core/cli-bridge.js +1094 -0
- package/dist/core/cli-bridge.js.map +1 -0
- package/dist/core/config-manager.d.ts +65 -0
- package/dist/core/config-manager.d.ts.map +1 -0
- package/dist/core/config-manager.js +266 -0
- package/dist/core/config-manager.js.map +1 -0
- package/dist/core/coverage-checker.d.ts +14 -0
- package/dist/core/coverage-checker.d.ts.map +1 -0
- package/dist/core/coverage-checker.js +176 -0
- package/dist/core/coverage-checker.js.map +1 -0
- package/dist/core/custom-templates.d.ts +27 -0
- package/dist/core/custom-templates.d.ts.map +1 -0
- package/dist/core/custom-templates.js +122 -0
- package/dist/core/custom-templates.js.map +1 -0
- package/dist/core/dependency-checker.d.ts +21 -0
- package/dist/core/dependency-checker.d.ts.map +1 -0
- package/dist/core/dependency-checker.js +247 -0
- package/dist/core/dependency-checker.js.map +1 -0
- package/dist/core/detector.d.ts +3 -0
- package/dist/core/detector.d.ts.map +1 -0
- package/dist/core/detector.js +1443 -0
- package/dist/core/detector.js.map +1 -0
- package/dist/core/docs-generator.d.ts +9 -0
- package/dist/core/docs-generator.d.ts.map +1 -0
- package/dist/core/docs-generator.js +531 -0
- package/dist/core/docs-generator.js.map +1 -0
- package/dist/core/generator.d.ts +16 -0
- package/dist/core/generator.d.ts.map +1 -0
- package/dist/core/generator.js +561 -0
- package/dist/core/generator.js.map +1 -0
- package/dist/core/gitignore-generator.d.ts +13 -0
- package/dist/core/gitignore-generator.d.ts.map +1 -0
- package/dist/core/gitignore-generator.js +307 -0
- package/dist/core/gitignore-generator.js.map +1 -0
- package/dist/core/health-scorer.d.ts +22 -0
- package/dist/core/health-scorer.d.ts.map +1 -0
- package/dist/core/health-scorer.js +395 -0
- package/dist/core/health-scorer.js.map +1 -0
- package/dist/core/logger.d.ts +116 -0
- package/dist/core/logger.d.ts.map +1 -0
- package/dist/core/logger.js +289 -0
- package/dist/core/logger.js.map +1 -0
- package/dist/core/merger.d.ts +6 -0
- package/dist/core/merger.d.ts.map +1 -0
- package/dist/core/merger.js +131 -0
- package/dist/core/merger.js.map +1 -0
- package/dist/core/migrator.d.ts +19 -0
- package/dist/core/migrator.d.ts.map +1 -0
- package/dist/core/migrator.js +102 -0
- package/dist/core/migrator.js.map +1 -0
- package/dist/core/minimal-scaffolder.d.ts +8 -0
- package/dist/core/minimal-scaffolder.d.ts.map +1 -0
- package/dist/core/minimal-scaffolder.js +51 -0
- package/dist/core/minimal-scaffolder.js.map +1 -0
- package/dist/core/modern-console-new.d.ts +81 -0
- package/dist/core/modern-console-new.d.ts.map +1 -0
- package/dist/core/modern-console-new.js +340 -0
- package/dist/core/modern-console-new.js.map +1 -0
- package/dist/core/modern-console.d.ts +99 -0
- package/dist/core/modern-console.d.ts.map +1 -0
- package/dist/core/modern-console.js +568 -0
- package/dist/core/modern-console.js.map +1 -0
- package/dist/core/openspec-manager.d.ts +133 -0
- package/dist/core/openspec-manager.d.ts.map +1 -0
- package/dist/core/openspec-manager.js +605 -0
- package/dist/core/openspec-manager.js.map +1 -0
- package/dist/core/openspec-migrator.d.ts +27 -0
- package/dist/core/openspec-migrator.d.ts.map +1 -0
- package/dist/core/openspec-migrator.js +255 -0
- package/dist/core/openspec-migrator.js.map +1 -0
- package/dist/core/task-manager.d.ts +65 -0
- package/dist/core/task-manager.d.ts.map +1 -0
- package/dist/core/task-manager.js +318 -0
- package/dist/core/task-manager.js.map +1 -0
- package/dist/core/test-task-manager.d.ts +49 -0
- package/dist/core/test-task-manager.d.ts.map +1 -0
- package/dist/core/test-task-manager.js +121 -0
- package/dist/core/test-task-manager.js.map +1 -0
- package/dist/core/validator.d.ts +21 -0
- package/dist/core/validator.d.ts.map +1 -0
- package/dist/core/validator.js +177 -0
- package/dist/core/validator.js.map +1 -0
- package/dist/core/version-bumper.d.ts +19 -0
- package/dist/core/version-bumper.d.ts.map +1 -0
- package/dist/core/version-bumper.js +180 -0
- package/dist/core/version-bumper.js.map +1 -0
- package/dist/core/watcher.d.ts +9 -0
- package/dist/core/watcher.d.ts.map +1 -0
- package/dist/core/watcher.js +22 -0
- package/dist/core/watcher.js.map +1 -0
- package/dist/core/workflow-generator.d.ts +10 -0
- package/dist/core/workflow-generator.d.ts.map +1 -0
- package/dist/core/workflow-generator.js +279 -0
- package/dist/core/workflow-generator.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +159 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp/handlers/archive-task.d.ts +17 -0
- package/dist/mcp/handlers/archive-task.d.ts.map +1 -0
- package/dist/mcp/handlers/archive-task.js +36 -0
- package/dist/mcp/handlers/archive-task.js.map +1 -0
- package/dist/mcp/handlers/create-task.d.ts +17 -0
- package/dist/mcp/handlers/create-task.d.ts.map +1 -0
- package/dist/mcp/handlers/create-task.js +56 -0
- package/dist/mcp/handlers/create-task.js.map +1 -0
- package/dist/mcp/handlers/list-tasks.d.ts +22 -0
- package/dist/mcp/handlers/list-tasks.d.ts.map +1 -0
- package/dist/mcp/handlers/list-tasks.js +42 -0
- package/dist/mcp/handlers/list-tasks.js.map +1 -0
- package/dist/mcp/handlers/show-task.d.ts +25 -0
- package/dist/mcp/handlers/show-task.d.ts.map +1 -0
- package/dist/mcp/handlers/show-task.js +43 -0
- package/dist/mcp/handlers/show-task.js.map +1 -0
- package/dist/mcp/handlers/update-task.d.ts +17 -0
- package/dist/mcp/handlers/update-task.d.ts.map +1 -0
- package/dist/mcp/handlers/update-task.js +35 -0
- package/dist/mcp/handlers/update-task.js.map +1 -0
- package/dist/mcp/handlers/validate-task.d.ts +15 -0
- package/dist/mcp/handlers/validate-task.d.ts.map +1 -0
- package/dist/mcp/handlers/validate-task.js +27 -0
- package/dist/mcp/handlers/validate-task.js.map +1 -0
- package/dist/mcp/rulebook-config.d.ts +22 -0
- package/dist/mcp/rulebook-config.d.ts.map +1 -0
- package/dist/mcp/rulebook-config.js +65 -0
- package/dist/mcp/rulebook-config.js.map +1 -0
- package/dist/mcp/rulebook-server.d.ts +4 -0
- package/dist/mcp/rulebook-server.d.ts.map +1 -0
- package/dist/mcp/rulebook-server.js +246 -0
- package/dist/mcp/rulebook-server.js.map +1 -0
- package/dist/types.d.ts +190 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/file-system.d.ts +9 -0
- package/dist/utils/file-system.d.ts.map +1 -0
- package/dist/utils/file-system.js +51 -0
- package/dist/utils/file-system.js.map +1 -0
- package/dist/utils/git-hooks.d.ts +8 -0
- package/dist/utils/git-hooks.d.ts.map +1 -0
- package/dist/utils/git-hooks.js +440 -0
- package/dist/utils/git-hooks.js.map +1 -0
- package/dist/utils/rulesignore.d.ts +9 -0
- package/dist/utils/rulesignore.d.ts.map +1 -0
- package/dist/utils/rulesignore.js +42 -0
- package/dist/utils/rulesignore.js.map +1 -0
- package/package.json +106 -0
- package/templates/cli/AIDER.md +49 -0
- package/templates/cli/AMAZON_Q.md +25 -0
- package/templates/cli/AUGGIE.md +32 -0
- package/templates/cli/CLAUDE.md +32 -0
- package/templates/cli/CLAUDE_CODE.md +35 -0
- package/templates/cli/CLINE.md +32 -0
- package/templates/cli/CODEBUDDY.md +20 -0
- package/templates/cli/CODEIUM.md +20 -0
- package/templates/cli/CODEX.md +21 -0
- package/templates/cli/CONTINUE.md +34 -0
- package/templates/cli/CURSOR_CLI.md +28 -0
- package/templates/cli/FACTORY.md +18 -0
- package/templates/cli/GEMINI.md +35 -0
- package/templates/cli/KILOCODE.md +18 -0
- package/templates/cli/OPENCODE.md +18 -0
- package/templates/cli/_GENERIC_TEMPLATE.md +29 -0
- package/templates/commands/rulebook-task-apply.md +67 -0
- package/templates/commands/rulebook-task-archive.md +70 -0
- package/templates/commands/rulebook-task-create.md +93 -0
- package/templates/commands/rulebook-task-list.md +42 -0
- package/templates/commands/rulebook-task-show.md +52 -0
- package/templates/commands/rulebook-task-validate.md +53 -0
- package/templates/core/AGENT_AUTOMATION.md +184 -0
- package/templates/core/DAG.md +304 -0
- package/templates/core/DOCUMENTATION_RULES.md +37 -0
- package/templates/core/QUALITY_ENFORCEMENT.md +68 -0
- package/templates/core/RULEBOOK.md +1874 -0
- package/templates/frameworks/ANGULAR.md +36 -0
- package/templates/frameworks/DJANGO.md +83 -0
- package/templates/frameworks/ELECTRON.md +147 -0
- package/templates/frameworks/FLASK.md +38 -0
- package/templates/frameworks/FLUTTER.md +55 -0
- package/templates/frameworks/JQUERY.md +32 -0
- package/templates/frameworks/LARAVEL.md +38 -0
- package/templates/frameworks/NESTJS.md +43 -0
- package/templates/frameworks/NEXTJS.md +127 -0
- package/templates/frameworks/NUXT.md +40 -0
- package/templates/frameworks/RAILS.md +66 -0
- package/templates/frameworks/REACT.md +38 -0
- package/templates/frameworks/REACT_NATIVE.md +47 -0
- package/templates/frameworks/SPRING.md +39 -0
- package/templates/frameworks/SYMFONY.md +36 -0
- package/templates/frameworks/VUE.md +36 -0
- package/templates/frameworks/ZEND.md +35 -0
- package/templates/git/CI_CD_PATTERNS.md +661 -0
- package/templates/git/GITHUB_ACTIONS.md +728 -0
- package/templates/git/GITLAB_CI.md +730 -0
- package/templates/git/GIT_WORKFLOW.md +1157 -0
- package/templates/git/SECRETS_MANAGEMENT.md +585 -0
- package/templates/hooks/COMMIT_MSG.md +530 -0
- package/templates/hooks/POST_CHECKOUT.md +546 -0
- package/templates/hooks/PREPARE_COMMIT_MSG.md +619 -0
- package/templates/hooks/PRE_COMMIT.md +414 -0
- package/templates/hooks/PRE_PUSH.md +601 -0
- package/templates/hooks/csharp-pre-commit.sh +23 -0
- package/templates/hooks/csharp-pre-push.sh +23 -0
- package/templates/hooks/dart-pre-commit.sh +30 -0
- package/templates/hooks/dart-pre-push.sh +25 -0
- package/templates/hooks/elixir-pre-commit.sh +32 -0
- package/templates/hooks/elixir-pre-push.sh +31 -0
- package/templates/hooks/erlang-pre-commit.sh +30 -0
- package/templates/hooks/erlang-pre-push.sh +37 -0
- package/templates/hooks/go-pre-commit.sh +40 -0
- package/templates/hooks/go-pre-push.sh +31 -0
- package/templates/hooks/haskell-pre-commit.sh +41 -0
- package/templates/hooks/haskell-pre-push.sh +37 -0
- package/templates/hooks/java-pre-commit.sh +34 -0
- package/templates/hooks/java-pre-push.sh +24 -0
- package/templates/hooks/kotlin-pre-commit.sh +32 -0
- package/templates/hooks/kotlin-pre-push.sh +16 -0
- package/templates/hooks/php-pre-commit.sh +36 -0
- package/templates/hooks/php-pre-push.sh +26 -0
- package/templates/hooks/python-pre-commit.sh +51 -0
- package/templates/hooks/python-pre-push.sh +25 -0
- package/templates/hooks/ruby-pre-commit.sh +33 -0
- package/templates/hooks/ruby-pre-push.sh +32 -0
- package/templates/hooks/rust-pre-commit.sh +30 -0
- package/templates/hooks/rust-pre-push.sh +30 -0
- package/templates/hooks/scala-pre-commit.sh +32 -0
- package/templates/hooks/scala-pre-push.sh +24 -0
- package/templates/hooks/swift-pre-commit.sh +25 -0
- package/templates/hooks/swift-pre-push.sh +23 -0
- package/templates/hooks/typescript-pre-commit.sh +37 -0
- package/templates/hooks/typescript-pre-push.sh +36 -0
- package/templates/ides/COPILOT.md +37 -0
- package/templates/ides/CURSOR.md +43 -0
- package/templates/ides/JETBRAINS_AI.md +35 -0
- package/templates/ides/REPLIT.md +36 -0
- package/templates/ides/TABNINE.md +29 -0
- package/templates/ides/VSCODE.md +40 -0
- package/templates/ides/WINDSURF.md +36 -0
- package/templates/ides/ZED.md +32 -0
- package/templates/languages/ADA.md +58 -0
- package/templates/languages/C.md +333 -0
- package/templates/languages/CPP.md +743 -0
- package/templates/languages/CSHARP.md +417 -0
- package/templates/languages/DART.md +332 -0
- package/templates/languages/ELIXIR.md +454 -0
- package/templates/languages/ERLANG.md +361 -0
- package/templates/languages/GO.md +645 -0
- package/templates/languages/HASKELL.md +177 -0
- package/templates/languages/JAVA.md +607 -0
- package/templates/languages/JAVASCRIPT.md +631 -0
- package/templates/languages/JULIA.md +97 -0
- package/templates/languages/KOTLIN.md +511 -0
- package/templates/languages/LISP.md +100 -0
- package/templates/languages/LUA.md +74 -0
- package/templates/languages/OBJECTIVEC.md +90 -0
- package/templates/languages/PHP.md +416 -0
- package/templates/languages/PYTHON.md +682 -0
- package/templates/languages/R.md +350 -0
- package/templates/languages/RUBY.md +421 -0
- package/templates/languages/RUST.md +477 -0
- package/templates/languages/SAS.md +73 -0
- package/templates/languages/SCALA.md +348 -0
- package/templates/languages/SOLIDITY.md +580 -0
- package/templates/languages/SQL.md +137 -0
- package/templates/languages/SWIFT.md +466 -0
- package/templates/languages/TYPESCRIPT.md +591 -0
- package/templates/languages/ZIG.md +265 -0
- package/templates/modules/ATLASSIAN.md +255 -0
- package/templates/modules/CONTEXT7.md +54 -0
- package/templates/modules/FIGMA.md +267 -0
- package/templates/modules/GITHUB_MCP.md +64 -0
- package/templates/modules/GRAFANA.md +328 -0
- package/templates/modules/NOTION.md +247 -0
- package/templates/modules/PLAYWRIGHT.md +90 -0
- package/templates/modules/RULEBOOK_MCP.md +156 -0
- package/templates/modules/SERENA.md +337 -0
- package/templates/modules/SUPABASE.md +223 -0
- package/templates/modules/SYNAP.md +69 -0
- package/templates/modules/VECTORIZER.md +63 -0
- package/templates/services/AZURE_BLOB.md +184 -0
- package/templates/services/CASSANDRA.md +239 -0
- package/templates/services/DYNAMODB.md +308 -0
- package/templates/services/ELASTICSEARCH.md +347 -0
- package/templates/services/GCS.md +178 -0
- package/templates/services/INFLUXDB.md +265 -0
- package/templates/services/KAFKA.md +341 -0
- package/templates/services/MARIADB.md +183 -0
- package/templates/services/MEMCACHED.md +242 -0
- package/templates/services/MINIO.md +201 -0
- package/templates/services/MONGODB.md +268 -0
- package/templates/services/MYSQL.md +358 -0
- package/templates/services/NEO4J.md +247 -0
- package/templates/services/ORACLE.md +290 -0
- package/templates/services/POSTGRESQL.md +326 -0
- package/templates/services/RABBITMQ.md +286 -0
- package/templates/services/REDIS.md +292 -0
- package/templates/services/S3.md +298 -0
- package/templates/services/SQLITE.md +294 -0
- package/templates/services/SQLSERVER.md +294 -0
- package/templates/workflows/codespell.yml +31 -0
- package/templates/workflows/cpp-lint.yml +47 -0
- package/templates/workflows/cpp-publish.yml +119 -0
- package/templates/workflows/cpp-test.yml +77 -0
- package/templates/workflows/dotnet-lint.yml +29 -0
- package/templates/workflows/dotnet-publish.yml +40 -0
- package/templates/workflows/dotnet-test.yml +41 -0
- package/templates/workflows/elixir-lint.yml +45 -0
- package/templates/workflows/elixir-publish.yml +49 -0
- package/templates/workflows/elixir-test.yml +54 -0
- package/templates/workflows/erlang-lint.yml +47 -0
- package/templates/workflows/erlang-test.yml +62 -0
- package/templates/workflows/go-lint.yml +39 -0
- package/templates/workflows/go-publish.yml +95 -0
- package/templates/workflows/go-test.yml +59 -0
- package/templates/workflows/java-lint.yml +60 -0
- package/templates/workflows/java-publish.yml +120 -0
- package/templates/workflows/java-test.yml +85 -0
- package/templates/workflows/kotlin-lint.yml +34 -0
- package/templates/workflows/kotlin-publish.yml +56 -0
- package/templates/workflows/kotlin-test.yml +48 -0
- package/templates/workflows/php-lint.yml +39 -0
- package/templates/workflows/php-publish.yml +50 -0
- package/templates/workflows/php-test.yml +54 -0
- package/templates/workflows/python-lint.yml +47 -0
- package/templates/workflows/python-publish.yml +91 -0
- package/templates/workflows/python-test.yml +59 -0
- package/templates/workflows/rust-lint.yml +54 -0
- package/templates/workflows/rust-publish.yml +66 -0
- package/templates/workflows/rust-test.yml +75 -0
- package/templates/workflows/solidity-lint.yml +41 -0
- package/templates/workflows/solidity-test.yml +47 -0
- package/templates/workflows/swift-lint.yml +32 -0
- package/templates/workflows/swift-publish.yml +58 -0
- package/templates/workflows/swift-test.yml +44 -0
- package/templates/workflows/typescript-lint.yml +61 -0
- package/templates/workflows/typescript-publish.yml +60 -0
- package/templates/workflows/typescript-test.yml +73 -0
- package/templates/workflows/zig-lint.yml +27 -0
- package/templates/workflows/zig-test.yml +40 -0
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
inputs:
|
|
8
|
+
tag:
|
|
9
|
+
description: 'Tag to publish (e.g., v1.0.0)'
|
|
10
|
+
required: true
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
publish:
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
permissions:
|
|
16
|
+
id-token: write # For trusted publishing
|
|
17
|
+
|
|
18
|
+
steps:
|
|
19
|
+
- uses: actions/checkout@v5
|
|
20
|
+
with:
|
|
21
|
+
ref: ${{ github.event.inputs.tag || github.ref }}
|
|
22
|
+
|
|
23
|
+
- name: Set up Python
|
|
24
|
+
uses: actions/setup-python@v5
|
|
25
|
+
with:
|
|
26
|
+
python-version: '3.12'
|
|
27
|
+
cache: 'pip'
|
|
28
|
+
|
|
29
|
+
- name: Install build dependencies
|
|
30
|
+
run: |
|
|
31
|
+
python -m pip install --upgrade pip
|
|
32
|
+
pip install build twine check-manifest
|
|
33
|
+
|
|
34
|
+
- name: Install package dependencies
|
|
35
|
+
run: |
|
|
36
|
+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
|
|
37
|
+
if [ -f pyproject.toml ]; then pip install .[dev]; fi
|
|
38
|
+
|
|
39
|
+
- name: Verify version matches tag
|
|
40
|
+
run: |
|
|
41
|
+
TAG="${{ github.event.inputs.tag || github.ref_name }}"
|
|
42
|
+
TAG_VERSION="${TAG#v}"
|
|
43
|
+
if [ -f pyproject.toml ]; then
|
|
44
|
+
VERSION=$(python -c "import tomli; print(tomli.load(open('pyproject.toml', 'rb'))['project']['version'])" 2>/dev/null || \
|
|
45
|
+
python -c "import toml; print(toml.load('pyproject.toml')['project']['version'])")
|
|
46
|
+
elif [ -f setup.py ]; then
|
|
47
|
+
VERSION=$(python setup.py --version)
|
|
48
|
+
fi
|
|
49
|
+
if [ "$VERSION" != "$TAG_VERSION" ]; then
|
|
50
|
+
echo "Error: Package version ($VERSION) does not match tag ($TAG_VERSION)"
|
|
51
|
+
exit 1
|
|
52
|
+
fi
|
|
53
|
+
echo "Version check passed: $VERSION"
|
|
54
|
+
|
|
55
|
+
- name: Check manifest
|
|
56
|
+
run: check-manifest
|
|
57
|
+
|
|
58
|
+
- name: Run tests
|
|
59
|
+
run: pytest
|
|
60
|
+
|
|
61
|
+
- name: Run linters
|
|
62
|
+
run: |
|
|
63
|
+
ruff check .
|
|
64
|
+
black --check .
|
|
65
|
+
mypy .
|
|
66
|
+
|
|
67
|
+
- name: Build package
|
|
68
|
+
run: python -m build
|
|
69
|
+
|
|
70
|
+
- name: Check package
|
|
71
|
+
run: twine check dist/*
|
|
72
|
+
|
|
73
|
+
- name: Publish to Test PyPI
|
|
74
|
+
if: github.event_name == 'workflow_dispatch'
|
|
75
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
76
|
+
with:
|
|
77
|
+
repository-url: https://test.pypi.org/legacy/
|
|
78
|
+
skip-existing: true
|
|
79
|
+
|
|
80
|
+
- name: Publish to PyPI
|
|
81
|
+
if: github.event_name == 'release'
|
|
82
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
83
|
+
# Uses trusted publishing, no token needed if configured in PyPI
|
|
84
|
+
|
|
85
|
+
- name: Verify publication
|
|
86
|
+
run: |
|
|
87
|
+
sleep 10
|
|
88
|
+
VERSION=$(python setup.py --version 2>/dev/null || python -c "import tomli; print(tomli.load(open('pyproject.toml', 'rb'))['project']['version'])")
|
|
89
|
+
pip index versions $(python -c "import tomli; print(tomli.load(open('pyproject.toml', 'rb'))['project']['name'])") || true
|
|
90
|
+
echo "Published version $VERSION to PyPI"
|
|
91
|
+
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
name: Python Tests
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ master, main, develop ]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [ '**' ]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
test:
|
|
11
|
+
runs-on: ${{ matrix.os }}
|
|
12
|
+
strategy:
|
|
13
|
+
matrix:
|
|
14
|
+
os: [ ubuntu-latest, windows-latest, macos-latest ]
|
|
15
|
+
python-version: [ '3.11', '3.12' ]
|
|
16
|
+
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v5
|
|
19
|
+
|
|
20
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
21
|
+
uses: actions/setup-python@v5
|
|
22
|
+
with:
|
|
23
|
+
python-version: ${{ matrix.python-version }}
|
|
24
|
+
# MONOREPO: Uncomment and adjust path if in monorepo subdirectory
|
|
25
|
+
# cache: 'pip'
|
|
26
|
+
# cache-dependency-path: 'subdirectory/requirements.txt'
|
|
27
|
+
# Note: Cache may fail in monorepo - disable if you get path resolution errors
|
|
28
|
+
|
|
29
|
+
- name: Install dependencies
|
|
30
|
+
# MONOREPO: Add working-directory if in subdirectory
|
|
31
|
+
# working-directory: ./subdirectory
|
|
32
|
+
run: |
|
|
33
|
+
python -m pip install --upgrade pip
|
|
34
|
+
pip install pytest pytest-cov
|
|
35
|
+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
|
|
36
|
+
if [ -f pyproject.toml ]; then pip install .; fi
|
|
37
|
+
shell: bash
|
|
38
|
+
|
|
39
|
+
- name: Run tests
|
|
40
|
+
# MONOREPO: Add working-directory and adjust --cov path if in subdirectory
|
|
41
|
+
# working-directory: ./subdirectory
|
|
42
|
+
run: pytest --cov=. --cov-report=xml --cov-report=term
|
|
43
|
+
|
|
44
|
+
- name: Upload coverage to Codecov
|
|
45
|
+
uses: codecov/codecov-action@v4
|
|
46
|
+
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12'
|
|
47
|
+
with:
|
|
48
|
+
files: ./coverage.xml
|
|
49
|
+
flags: unittests
|
|
50
|
+
fail_ci_if_error: false
|
|
51
|
+
|
|
52
|
+
- name: Security audit
|
|
53
|
+
run: |
|
|
54
|
+
echo "Running security audit..."
|
|
55
|
+
python -m pip install pip-audit
|
|
56
|
+
pip-audit || true
|
|
57
|
+
echo "Checking for outdated packages..."
|
|
58
|
+
pip list --outdated || true
|
|
59
|
+
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
name: Rust Lint
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ master, main, develop ]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [ '**' ]
|
|
8
|
+
|
|
9
|
+
env:
|
|
10
|
+
CARGO_TERM_COLOR: always
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
lint:
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
|
|
16
|
+
steps:
|
|
17
|
+
- name: Install minimal nightly (for fmt)
|
|
18
|
+
uses: dtolnay/rust-toolchain@nightly
|
|
19
|
+
with:
|
|
20
|
+
components: rustfmt
|
|
21
|
+
|
|
22
|
+
- name: Install minimal stable
|
|
23
|
+
uses: dtolnay/rust-toolchain@stable
|
|
24
|
+
with:
|
|
25
|
+
components: rustfmt, clippy
|
|
26
|
+
|
|
27
|
+
- uses: actions/checkout@v5
|
|
28
|
+
|
|
29
|
+
- uses: Swatinem/rust-cache@v2
|
|
30
|
+
# MONOREPO: Uncomment and set workspaces if in subdirectory
|
|
31
|
+
# with:
|
|
32
|
+
# workspaces: 'subdirectory'
|
|
33
|
+
# key: clippy
|
|
34
|
+
|
|
35
|
+
- name: Check code formatting
|
|
36
|
+
# MONOREPO: Add working-directory if in subdirectory
|
|
37
|
+
# working-directory: ./subdirectory
|
|
38
|
+
run: cargo fmt --all -- --check # Use stable rustfmt (nightly not required for edition 2024)
|
|
39
|
+
|
|
40
|
+
- name: Check cargo clippy warnings
|
|
41
|
+
# MONOREPO: Add working-directory if in subdirectory
|
|
42
|
+
# working-directory: ./subdirectory
|
|
43
|
+
run: cargo clippy --workspace -- -D warnings
|
|
44
|
+
|
|
45
|
+
- name: Check cargo clippy warnings for all targets
|
|
46
|
+
# MONOREPO: Add working-directory if in subdirectory
|
|
47
|
+
# working-directory: ./subdirectory
|
|
48
|
+
run: cargo clippy --workspace --all-targets -- -D warnings
|
|
49
|
+
|
|
50
|
+
- name: Check cargo clippy warnings for all targets and features
|
|
51
|
+
# MONOREPO: Add working-directory if in subdirectory
|
|
52
|
+
# working-directory: ./subdirectory
|
|
53
|
+
run: cargo clippy --workspace --all-targets --all-features -- -D warnings
|
|
54
|
+
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
name: Publish to crates.io
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
inputs:
|
|
8
|
+
tag:
|
|
9
|
+
description: 'Tag to publish (e.g., v1.0.0)'
|
|
10
|
+
required: true
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
publish:
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v5
|
|
18
|
+
with:
|
|
19
|
+
ref: ${{ github.event.inputs.tag || github.ref }}
|
|
20
|
+
|
|
21
|
+
- name: Setup Rust
|
|
22
|
+
uses: dtolnay/rust-toolchain@stable
|
|
23
|
+
|
|
24
|
+
- name: Cache Rust dependencies
|
|
25
|
+
uses: Swatinem/rust-cache@v2
|
|
26
|
+
|
|
27
|
+
- name: Verify version matches tag
|
|
28
|
+
run: |
|
|
29
|
+
TAG="${{ github.event.inputs.tag || github.ref_name }}"
|
|
30
|
+
VERSION=$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[0].version')
|
|
31
|
+
TAG_VERSION="${TAG#v}"
|
|
32
|
+
if [ "$VERSION" != "$TAG_VERSION" ]; then
|
|
33
|
+
echo "Error: Cargo.toml version ($VERSION) does not match tag ($TAG_VERSION)"
|
|
34
|
+
exit 1
|
|
35
|
+
fi
|
|
36
|
+
echo "Version check passed: $VERSION"
|
|
37
|
+
|
|
38
|
+
- name: Run tests
|
|
39
|
+
run: cargo test --all-features
|
|
40
|
+
|
|
41
|
+
- name: Run clippy
|
|
42
|
+
run: cargo clippy --all-features -- -D warnings
|
|
43
|
+
|
|
44
|
+
- name: Build release
|
|
45
|
+
run: cargo build --release --all-features
|
|
46
|
+
|
|
47
|
+
- name: Verify package contents
|
|
48
|
+
run: cargo package --list
|
|
49
|
+
|
|
50
|
+
- name: Publish to crates.io (dry-run)
|
|
51
|
+
run: cargo publish --dry-run --allow-dirty
|
|
52
|
+
|
|
53
|
+
- name: Publish to crates.io
|
|
54
|
+
run: cargo publish --token ${{ secrets.CARGO_TOKEN }}
|
|
55
|
+
env:
|
|
56
|
+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_TOKEN }}
|
|
57
|
+
|
|
58
|
+
- name: Wait for crates.io to update
|
|
59
|
+
run: sleep 30
|
|
60
|
+
|
|
61
|
+
- name: Verify published version
|
|
62
|
+
run: |
|
|
63
|
+
VERSION=$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[0].version')
|
|
64
|
+
PACKAGE=$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[0].name')
|
|
65
|
+
echo "Published $PACKAGE@$VERSION to crates.io"
|
|
66
|
+
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
name: Rust Tests
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ master, main, develop ]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [ '**' ]
|
|
8
|
+
|
|
9
|
+
env:
|
|
10
|
+
CARGO_TERM_COLOR: always
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
rust-tests:
|
|
14
|
+
runs-on: ${{ matrix.os }}
|
|
15
|
+
strategy:
|
|
16
|
+
matrix:
|
|
17
|
+
os: [ ubuntu-latest, windows-latest, macos-latest ]
|
|
18
|
+
|
|
19
|
+
steps:
|
|
20
|
+
- name: Install minimal stable
|
|
21
|
+
uses: dtolnay/rust-toolchain@stable
|
|
22
|
+
|
|
23
|
+
- uses: actions/checkout@v5
|
|
24
|
+
|
|
25
|
+
- uses: Swatinem/rust-cache@v2
|
|
26
|
+
# MONOREPO: Uncomment and set workspaces if in subdirectory
|
|
27
|
+
# with:
|
|
28
|
+
# workspaces: 'subdirectory'
|
|
29
|
+
|
|
30
|
+
- name: Install mold (Linux only)
|
|
31
|
+
if: runner.os == 'Linux'
|
|
32
|
+
uses: rui314/setup-mold@v1
|
|
33
|
+
|
|
34
|
+
- name: Configure mold linker (Linux only)
|
|
35
|
+
if: runner.os == 'Linux'
|
|
36
|
+
# MONOREPO: Add working-directory if in subdirectory
|
|
37
|
+
# working-directory: ./subdirectory
|
|
38
|
+
run: |
|
|
39
|
+
mkdir -p .cargo
|
|
40
|
+
echo "[target.x86_64-unknown-linux-gnu]" >> .cargo/config.toml
|
|
41
|
+
echo "linker = \"clang\"" >> .cargo/config.toml
|
|
42
|
+
echo "rustflags = [\"-C\", \"link-arg=-fuse-ld=/usr/local/bin/mold\"]" >> .cargo/config.toml
|
|
43
|
+
|
|
44
|
+
- name: Install nextest
|
|
45
|
+
uses: taiki-e/install-action@nextest
|
|
46
|
+
|
|
47
|
+
- name: Build
|
|
48
|
+
# MONOREPO: Add working-directory if in subdirectory
|
|
49
|
+
# working-directory: ./subdirectory
|
|
50
|
+
run: cargo build --tests --workspace
|
|
51
|
+
|
|
52
|
+
- name: Run tests
|
|
53
|
+
# MONOREPO: Add working-directory if in subdirectory
|
|
54
|
+
# working-directory: ./subdirectory
|
|
55
|
+
run: cargo nextest run --workspace || cargo test --workspace
|
|
56
|
+
|
|
57
|
+
- name: Upload test report
|
|
58
|
+
uses: actions/upload-artifact@v4
|
|
59
|
+
if: always()
|
|
60
|
+
with:
|
|
61
|
+
name: junit-${{ matrix.os }}.xml
|
|
62
|
+
path: target/nextest/default/junit.xml
|
|
63
|
+
if-no-files-found: ignore
|
|
64
|
+
|
|
65
|
+
- name: Security audit (optional)
|
|
66
|
+
# MONOREPO: Add working-directory if in subdirectory
|
|
67
|
+
# working-directory: ./subdirectory
|
|
68
|
+
run: |
|
|
69
|
+
echo "Security audit skipped (cargo-audit not pre-installed)"
|
|
70
|
+
echo "To enable: Install cargo-audit in a separate workflow step"
|
|
71
|
+
echo " - cargo install cargo-audit --locked"
|
|
72
|
+
echo " - cargo audit"
|
|
73
|
+
continue-on-error: true
|
|
74
|
+
shell: bash
|
|
75
|
+
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
name: Solidity Lint
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ master, main, develop ]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [ '**' ]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
lint:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@v5
|
|
15
|
+
|
|
16
|
+
# IMPORTANT: For cache to work, you MUST commit package-lock.json
|
|
17
|
+
# Remove package-lock.json from .gitignore if needed
|
|
18
|
+
|
|
19
|
+
- name: Setup Node.js
|
|
20
|
+
uses: actions/setup-node@v4
|
|
21
|
+
with:
|
|
22
|
+
node-version: '20.x'
|
|
23
|
+
cache: 'npm'
|
|
24
|
+
|
|
25
|
+
- name: Install dependencies
|
|
26
|
+
run: npm ci
|
|
27
|
+
|
|
28
|
+
- name: Check code formatting
|
|
29
|
+
run: npx prettier --check 'contracts/**/*.sol' 'test/**/*.js'
|
|
30
|
+
# or: forge fmt --check (for Foundry)
|
|
31
|
+
|
|
32
|
+
- name: Run Solhint
|
|
33
|
+
run: npx solhint 'contracts/**/*.sol'
|
|
34
|
+
|
|
35
|
+
- name: Run Slither security analysis
|
|
36
|
+
uses: crytic/slither-action@v0.3.0
|
|
37
|
+
with:
|
|
38
|
+
target: '.'
|
|
39
|
+
fail-on: medium
|
|
40
|
+
|
|
41
|
+
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
name: Solidity Tests
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ master, main, develop ]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [ '**' ]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
test:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@v5
|
|
15
|
+
|
|
16
|
+
# IMPORTANT: For cache to work, you MUST commit package-lock.json
|
|
17
|
+
# Remove package-lock.json from .gitignore if needed
|
|
18
|
+
|
|
19
|
+
- name: Setup Node.js
|
|
20
|
+
uses: actions/setup-node@v4
|
|
21
|
+
with:
|
|
22
|
+
node-version: '20.x'
|
|
23
|
+
cache: 'npm'
|
|
24
|
+
|
|
25
|
+
- name: Install dependencies
|
|
26
|
+
run: npm ci
|
|
27
|
+
|
|
28
|
+
- name: Compile contracts
|
|
29
|
+
run: npx hardhat compile
|
|
30
|
+
# or: forge build (for Foundry)
|
|
31
|
+
|
|
32
|
+
- name: Run tests
|
|
33
|
+
run: npx hardhat test
|
|
34
|
+
# or: forge test -vvv (for Foundry)
|
|
35
|
+
|
|
36
|
+
- name: Generate coverage report
|
|
37
|
+
run: npx hardhat coverage
|
|
38
|
+
# or: forge coverage (for Foundry)
|
|
39
|
+
|
|
40
|
+
- name: Upload coverage to Codecov
|
|
41
|
+
uses: codecov/codecov-action@v4
|
|
42
|
+
with:
|
|
43
|
+
files: ./coverage/lcov.info
|
|
44
|
+
flags: unittests
|
|
45
|
+
fail_ci_if_error: false
|
|
46
|
+
|
|
47
|
+
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
name: Swift Lint
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ master, main, develop ]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [ '**' ]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
lint:
|
|
11
|
+
runs-on: macos-latest
|
|
12
|
+
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@v5
|
|
15
|
+
|
|
16
|
+
- name: Select Xcode version
|
|
17
|
+
run: sudo xcode-select -s /Applications/Xcode_15.2.app
|
|
18
|
+
|
|
19
|
+
- name: Install SwiftLint
|
|
20
|
+
run: brew install swiftlint
|
|
21
|
+
|
|
22
|
+
- name: Run SwiftLint
|
|
23
|
+
run: swiftlint lint --strict
|
|
24
|
+
|
|
25
|
+
- name: Check formatting
|
|
26
|
+
run: |
|
|
27
|
+
brew install swift-format
|
|
28
|
+
swift-format lint --recursive Sources Tests
|
|
29
|
+
|
|
30
|
+
- name: Build with warnings as errors
|
|
31
|
+
run: swift build -Xswiftc -warnings-as-errors
|
|
32
|
+
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
name: Publish Swift Package
|
|
2
|
+
|
|
3
|
+
# Note: Swift packages are published via Git tags.
|
|
4
|
+
# This workflow validates the package before tagging.
|
|
5
|
+
|
|
6
|
+
on:
|
|
7
|
+
release:
|
|
8
|
+
types: [published]
|
|
9
|
+
workflow_dispatch:
|
|
10
|
+
inputs:
|
|
11
|
+
tag:
|
|
12
|
+
description: 'Tag to publish (e.g., 1.0.0)'
|
|
13
|
+
required: true
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
validate:
|
|
17
|
+
runs-on: macos-latest
|
|
18
|
+
|
|
19
|
+
steps:
|
|
20
|
+
- uses: actions/checkout@v5
|
|
21
|
+
with:
|
|
22
|
+
ref: ${{ github.event.inputs.tag || github.ref }}
|
|
23
|
+
|
|
24
|
+
- name: Select Xcode version
|
|
25
|
+
run: sudo xcode-select -s /Applications/Xcode_15.2.app
|
|
26
|
+
|
|
27
|
+
- name: Swift version
|
|
28
|
+
run: swift --version
|
|
29
|
+
|
|
30
|
+
- name: Run SwiftLint
|
|
31
|
+
run: |
|
|
32
|
+
brew install swiftlint
|
|
33
|
+
swiftlint lint --strict
|
|
34
|
+
|
|
35
|
+
- name: Build
|
|
36
|
+
run: swift build -Xswiftc -warnings-as-errors
|
|
37
|
+
|
|
38
|
+
- name: Run tests
|
|
39
|
+
run: swift test
|
|
40
|
+
|
|
41
|
+
- name: Generate documentation
|
|
42
|
+
run: |
|
|
43
|
+
swift package generate-documentation
|
|
44
|
+
echo "Documentation generated"
|
|
45
|
+
|
|
46
|
+
- name: Verify package
|
|
47
|
+
run: |
|
|
48
|
+
swift package resolve
|
|
49
|
+
swift package show-dependencies
|
|
50
|
+
|
|
51
|
+
- name: Package validated
|
|
52
|
+
run: |
|
|
53
|
+
TAG="${{ github.event.inputs.tag || github.ref_name }}"
|
|
54
|
+
echo "✅ Package validation successful"
|
|
55
|
+
echo "Package available at: https://github.com/${{ github.repository }}"
|
|
56
|
+
echo "Add to Package.swift:"
|
|
57
|
+
echo ".package(url: \"https://github.com/${{ github.repository }}.git\", from: \"$TAG\")"
|
|
58
|
+
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
name: Swift Tests
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ master, main, develop ]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [ '**' ]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
test:
|
|
11
|
+
runs-on: macos-latest
|
|
12
|
+
|
|
13
|
+
strategy:
|
|
14
|
+
matrix:
|
|
15
|
+
swift-version: [ '5.10' ]
|
|
16
|
+
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v5
|
|
19
|
+
|
|
20
|
+
- name: Select Xcode version
|
|
21
|
+
run: sudo xcode-select -s /Applications/Xcode_15.2.app
|
|
22
|
+
|
|
23
|
+
- name: Swift version
|
|
24
|
+
run: swift --version
|
|
25
|
+
|
|
26
|
+
- name: Build
|
|
27
|
+
run: swift build -v
|
|
28
|
+
|
|
29
|
+
- name: Run tests
|
|
30
|
+
run: swift test -v --enable-code-coverage
|
|
31
|
+
|
|
32
|
+
- name: Generate coverage report
|
|
33
|
+
run: |
|
|
34
|
+
xcrun llvm-cov export -format="lcov" \
|
|
35
|
+
.build/debug/YourPackagePackageTests.xctest/Contents/MacOS/YourPackagePackageTests \
|
|
36
|
+
-instr-profile .build/debug/codecov/default.profdata > coverage.lcov
|
|
37
|
+
|
|
38
|
+
- name: Upload coverage to Codecov
|
|
39
|
+
uses: codecov/codecov-action@v4
|
|
40
|
+
with:
|
|
41
|
+
files: ./coverage.lcov
|
|
42
|
+
flags: unittests
|
|
43
|
+
fail_ci_if_error: false
|
|
44
|
+
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
name: TypeScript Lint
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ master, main, develop ]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [ '**' ]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
lint:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@v5
|
|
15
|
+
|
|
16
|
+
# IMPORTANT: For cache to work, you MUST commit package-lock.json
|
|
17
|
+
# Remove package-lock.json from .gitignore if needed
|
|
18
|
+
|
|
19
|
+
# For pnpm projects, add this step before setup-node:
|
|
20
|
+
# - name: Install pnpm
|
|
21
|
+
# uses: pnpm/action-setup@v3
|
|
22
|
+
# with:
|
|
23
|
+
# version: 8
|
|
24
|
+
|
|
25
|
+
- name: Setup Node.js
|
|
26
|
+
uses: actions/setup-node@v5
|
|
27
|
+
with:
|
|
28
|
+
node-version: '20.x'
|
|
29
|
+
# MONOREPO: Uncomment and adjust path if in monorepo subdirectory
|
|
30
|
+
# cache: 'npm' # Change to 'pnpm' or 'yarn' as needed
|
|
31
|
+
# cache-dependency-path: 'subdirectory/package-lock.json'
|
|
32
|
+
# Note: Cache may fail in monorepo - disable if you get path resolution errors
|
|
33
|
+
|
|
34
|
+
- name: Install dependencies
|
|
35
|
+
# MONOREPO: Add working-directory if in subdirectory
|
|
36
|
+
# working-directory: ./subdirectory
|
|
37
|
+
run: npm ci # For pnpm: pnpm install --frozen-lockfile | For yarn: yarn install --frozen-lockfile
|
|
38
|
+
|
|
39
|
+
- name: Type check
|
|
40
|
+
# MONOREPO: Add working-directory if in subdirectory
|
|
41
|
+
# working-directory: ./subdirectory
|
|
42
|
+
run: npx tsc --noEmit # Or: npm run type-check
|
|
43
|
+
|
|
44
|
+
- name: Run ESLint
|
|
45
|
+
# MONOREPO: Add working-directory if in subdirectory
|
|
46
|
+
# working-directory: ./subdirectory
|
|
47
|
+
run: npm run lint # For pnpm: pnpm run lint | For yarn: yarn lint
|
|
48
|
+
|
|
49
|
+
- name: Check code formatting
|
|
50
|
+
# MONOREPO: Add working-directory if in subdirectory
|
|
51
|
+
# working-directory: ./subdirectory
|
|
52
|
+
run: npm run format -- --check || echo "Format check skipped"
|
|
53
|
+
continue-on-error: true # Don't fail if format check not configured
|
|
54
|
+
|
|
55
|
+
- name: Security audit
|
|
56
|
+
run: |
|
|
57
|
+
echo "Running security audit..."
|
|
58
|
+
npm audit --production --audit-level=moderate || true
|
|
59
|
+
echo "Checking for outdated dependencies..."
|
|
60
|
+
npm outdated || true
|
|
61
|
+
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
name: Publish to npm
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
inputs:
|
|
8
|
+
tag:
|
|
9
|
+
description: 'Tag to publish (e.g., v1.0.0)'
|
|
10
|
+
required: true
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
publish:
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
permissions:
|
|
16
|
+
contents: read
|
|
17
|
+
id-token: write # For npm provenance
|
|
18
|
+
|
|
19
|
+
steps:
|
|
20
|
+
- uses: actions/checkout@v5
|
|
21
|
+
with:
|
|
22
|
+
ref: ${{ github.event.inputs.tag || github.ref }}
|
|
23
|
+
|
|
24
|
+
# IMPORTANT: For cache to work, you MUST commit package-lock.json
|
|
25
|
+
# Remove package-lock.json from .gitignore if needed
|
|
26
|
+
|
|
27
|
+
- name: Setup Node.js
|
|
28
|
+
uses: actions/setup-node@v4
|
|
29
|
+
with:
|
|
30
|
+
node-version: '20.x'
|
|
31
|
+
registry-url: 'https://registry.npmjs.org'
|
|
32
|
+
cache: 'npm'
|
|
33
|
+
|
|
34
|
+
- name: Install dependencies
|
|
35
|
+
run: npm ci
|
|
36
|
+
|
|
37
|
+
- name: Run tests
|
|
38
|
+
run: npm test
|
|
39
|
+
|
|
40
|
+
- name: Build
|
|
41
|
+
run: npm run build
|
|
42
|
+
|
|
43
|
+
- name: Verify package contents
|
|
44
|
+
run: |
|
|
45
|
+
npm pack --dry-run
|
|
46
|
+
echo "Package contents verified"
|
|
47
|
+
|
|
48
|
+
- name: Publish to npm
|
|
49
|
+
run: npm publish --provenance --access public
|
|
50
|
+
env:
|
|
51
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
52
|
+
|
|
53
|
+
- name: Create GitHub Release Notes
|
|
54
|
+
if: github.event_name == 'release'
|
|
55
|
+
uses: actions/github-script@v7
|
|
56
|
+
with:
|
|
57
|
+
script: |
|
|
58
|
+
const package = require('./package.json');
|
|
59
|
+
console.log(`Published ${package.name}@${package.version} to npm`);
|
|
60
|
+
|