@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,66 +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
|
-
|
|
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
|
+
|
|
@@ -1,75 +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
|
-
|
|
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
|
+
|
|
@@ -1,41 +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
|
-
|
|
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
|
+
|
|
@@ -1,47 +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
|
-
|
|
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
|
+
|
|
@@ -1,32 +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
|
-
|
|
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
|
+
|
|
@@ -1,58 +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
|
-
|
|
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
|
+
|