@hivehub/rulebook 5.4.0 → 5.5.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 -191
- package/README.md +1 -0
- package/dist/core/generator.d.ts +1 -1
- package/dist/core/generator.d.ts.map +1 -1
- package/dist/core/generator.js +1 -0
- package/dist/core/generator.js.map +1 -1
- package/package.json +1 -1
- package/templates/cli/gemini-extension.json +77 -77
- package/templates/core/AGENTS_LEAN.md +9 -0
- package/templates/core/CLAUDE_MD_v2.md +9 -0
- package/templates/core/WORKSPACE.md +69 -69
- package/templates/skills/core/karpathy-guidelines/SKILL.md +93 -0
- package/templates/workflows/codespell.yml +31 -31
- package/templates/workflows/cpp-lint.yml +47 -47
- package/templates/workflows/cpp-publish.yml +119 -119
- package/templates/workflows/cpp-test.yml +77 -77
- package/templates/workflows/dotnet-lint.yml +29 -29
- package/templates/workflows/dotnet-publish.yml +40 -40
- package/templates/workflows/dotnet-test.yml +41 -41
- package/templates/workflows/elixir-lint.yml +45 -45
- package/templates/workflows/elixir-publish.yml +49 -49
- package/templates/workflows/elixir-test.yml +54 -54
- package/templates/workflows/erlang-lint.yml +47 -47
- package/templates/workflows/erlang-test.yml +62 -62
- package/templates/workflows/go-lint.yml +39 -39
- package/templates/workflows/go-publish.yml +95 -95
- package/templates/workflows/go-test.yml +59 -59
- package/templates/workflows/java-lint.yml +60 -60
- package/templates/workflows/java-publish.yml +120 -120
- package/templates/workflows/java-test.yml +85 -85
- package/templates/workflows/kotlin-lint.yml +34 -34
- package/templates/workflows/kotlin-publish.yml +56 -56
- package/templates/workflows/kotlin-test.yml +48 -48
- package/templates/workflows/php-lint.yml +39 -39
- package/templates/workflows/php-publish.yml +50 -50
- package/templates/workflows/php-test.yml +54 -54
- package/templates/workflows/python-lint.yml +47 -47
- package/templates/workflows/python-publish.yml +91 -91
- package/templates/workflows/python-test.yml +59 -59
- package/templates/workflows/rust-lint.yml +54 -54
- package/templates/workflows/rust-publish.yml +66 -66
- package/templates/workflows/rust-test.yml +75 -75
- package/templates/workflows/solidity-lint.yml +41 -41
- package/templates/workflows/solidity-test.yml +47 -47
- package/templates/workflows/swift-lint.yml +32 -32
- package/templates/workflows/swift-publish.yml +58 -58
- package/templates/workflows/swift-test.yml +44 -44
- package/templates/workflows/typescript-publish.yml +60 -60
- package/templates/workflows/typescript-test.yml +73 -73
- package/templates/workflows/zig-lint.yml +27 -27
- package/templates/workflows/zig-test.yml +40 -40
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
name: PHP 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 ]
|
|
15
|
-
php-version: [ '8.2', '8.3' ]
|
|
16
|
-
|
|
17
|
-
steps:
|
|
18
|
-
- uses: actions/checkout@v5
|
|
19
|
-
|
|
20
|
-
- name: Setup PHP
|
|
21
|
-
uses: shivammathur/setup-php@v2
|
|
22
|
-
with:
|
|
23
|
-
php-version: ${{ matrix.php-version }}
|
|
24
|
-
extensions: mbstring, xml, ctype, iconv, intl, pdo_sqlite, dom, filter, gd, json, pcov
|
|
25
|
-
coverage: pcov
|
|
26
|
-
|
|
27
|
-
- name: Validate composer.json
|
|
28
|
-
run: composer validate --strict
|
|
29
|
-
|
|
30
|
-
- name: Cache Composer packages
|
|
31
|
-
uses: actions/cache@v4
|
|
32
|
-
with:
|
|
33
|
-
path: vendor
|
|
34
|
-
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
|
|
35
|
-
restore-keys: ${{ runner.os }}-php-
|
|
36
|
-
|
|
37
|
-
- name: Install dependencies
|
|
38
|
-
run: composer install --prefer-dist --no-progress
|
|
39
|
-
|
|
40
|
-
- name: Run tests
|
|
41
|
-
run: composer test
|
|
42
|
-
|
|
43
|
-
- name: Generate coverage report
|
|
44
|
-
if: matrix.os == 'ubuntu-latest' && matrix.php-version == '8.3'
|
|
45
|
-
run: ./vendor/bin/phpunit --coverage-clover coverage.xml
|
|
46
|
-
|
|
47
|
-
- name: Upload coverage to Codecov
|
|
48
|
-
uses: codecov/codecov-action@v4
|
|
49
|
-
if: matrix.os == 'ubuntu-latest' && matrix.php-version == '8.3'
|
|
50
|
-
with:
|
|
51
|
-
files: ./coverage.xml
|
|
52
|
-
flags: unittests
|
|
53
|
-
fail_ci_if_error: false
|
|
54
|
-
|
|
1
|
+
name: PHP 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 ]
|
|
15
|
+
php-version: [ '8.2', '8.3' ]
|
|
16
|
+
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v5
|
|
19
|
+
|
|
20
|
+
- name: Setup PHP
|
|
21
|
+
uses: shivammathur/setup-php@v2
|
|
22
|
+
with:
|
|
23
|
+
php-version: ${{ matrix.php-version }}
|
|
24
|
+
extensions: mbstring, xml, ctype, iconv, intl, pdo_sqlite, dom, filter, gd, json, pcov
|
|
25
|
+
coverage: pcov
|
|
26
|
+
|
|
27
|
+
- name: Validate composer.json
|
|
28
|
+
run: composer validate --strict
|
|
29
|
+
|
|
30
|
+
- name: Cache Composer packages
|
|
31
|
+
uses: actions/cache@v4
|
|
32
|
+
with:
|
|
33
|
+
path: vendor
|
|
34
|
+
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
|
|
35
|
+
restore-keys: ${{ runner.os }}-php-
|
|
36
|
+
|
|
37
|
+
- name: Install dependencies
|
|
38
|
+
run: composer install --prefer-dist --no-progress
|
|
39
|
+
|
|
40
|
+
- name: Run tests
|
|
41
|
+
run: composer test
|
|
42
|
+
|
|
43
|
+
- name: Generate coverage report
|
|
44
|
+
if: matrix.os == 'ubuntu-latest' && matrix.php-version == '8.3'
|
|
45
|
+
run: ./vendor/bin/phpunit --coverage-clover coverage.xml
|
|
46
|
+
|
|
47
|
+
- name: Upload coverage to Codecov
|
|
48
|
+
uses: codecov/codecov-action@v4
|
|
49
|
+
if: matrix.os == 'ubuntu-latest' && matrix.php-version == '8.3'
|
|
50
|
+
with:
|
|
51
|
+
files: ./coverage.xml
|
|
52
|
+
flags: unittests
|
|
53
|
+
fail_ci_if_error: false
|
|
54
|
+
|
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
name: Python 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
|
-
- name: Set up Python
|
|
17
|
-
uses: actions/setup-python@v5
|
|
18
|
-
with:
|
|
19
|
-
python-version: '3.12'
|
|
20
|
-
# MONOREPO: Uncomment and adjust path if in monorepo subdirectory
|
|
21
|
-
# cache: 'pip'
|
|
22
|
-
# cache-dependency-path: 'subdirectory/requirements.txt'
|
|
23
|
-
# Note: Cache may fail in monorepo - disable if you get path resolution errors
|
|
24
|
-
|
|
25
|
-
- name: Install dependencies
|
|
26
|
-
# MONOREPO: Add working-directory if in subdirectory
|
|
27
|
-
# working-directory: ./subdirectory
|
|
28
|
-
run: |
|
|
29
|
-
python -m pip install --upgrade pip
|
|
30
|
-
pip install ruff mypy black
|
|
31
|
-
|
|
32
|
-
- name: Check code formatting with black
|
|
33
|
-
# MONOREPO: Add working-directory if in subdirectory
|
|
34
|
-
# working-directory: ./subdirectory
|
|
35
|
-
run: black --check .
|
|
36
|
-
|
|
37
|
-
- name: Run ruff linter
|
|
38
|
-
# MONOREPO: Add working-directory if in subdirectory
|
|
39
|
-
# working-directory: ./subdirectory
|
|
40
|
-
run: ruff check .
|
|
41
|
-
|
|
42
|
-
- name: Run mypy type checker
|
|
43
|
-
# MONOREPO: Add working-directory if in subdirectory
|
|
44
|
-
# working-directory: ./subdirectory
|
|
45
|
-
run: mypy . || echo "Type checking optional"
|
|
46
|
-
continue-on-error: true
|
|
47
|
-
|
|
1
|
+
name: Python 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
|
+
- name: Set up Python
|
|
17
|
+
uses: actions/setup-python@v5
|
|
18
|
+
with:
|
|
19
|
+
python-version: '3.12'
|
|
20
|
+
# MONOREPO: Uncomment and adjust path if in monorepo subdirectory
|
|
21
|
+
# cache: 'pip'
|
|
22
|
+
# cache-dependency-path: 'subdirectory/requirements.txt'
|
|
23
|
+
# Note: Cache may fail in monorepo - disable if you get path resolution errors
|
|
24
|
+
|
|
25
|
+
- name: Install dependencies
|
|
26
|
+
# MONOREPO: Add working-directory if in subdirectory
|
|
27
|
+
# working-directory: ./subdirectory
|
|
28
|
+
run: |
|
|
29
|
+
python -m pip install --upgrade pip
|
|
30
|
+
pip install ruff mypy black
|
|
31
|
+
|
|
32
|
+
- name: Check code formatting with black
|
|
33
|
+
# MONOREPO: Add working-directory if in subdirectory
|
|
34
|
+
# working-directory: ./subdirectory
|
|
35
|
+
run: black --check .
|
|
36
|
+
|
|
37
|
+
- name: Run ruff linter
|
|
38
|
+
# MONOREPO: Add working-directory if in subdirectory
|
|
39
|
+
# working-directory: ./subdirectory
|
|
40
|
+
run: ruff check .
|
|
41
|
+
|
|
42
|
+
- name: Run mypy type checker
|
|
43
|
+
# MONOREPO: Add working-directory if in subdirectory
|
|
44
|
+
# working-directory: ./subdirectory
|
|
45
|
+
run: mypy . || echo "Type checking optional"
|
|
46
|
+
continue-on-error: true
|
|
47
|
+
|
|
@@ -1,91 +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
|
-
|
|
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
|
+
|
|
@@ -1,59 +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
|
-
|
|
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
|
+
|
|
@@ -1,54 +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
|
-
|
|
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
|
+
|