Skip to content

Commit 3bf7d57

Browse files
authored
Merge pull request #1 from ch4r10t33r/feature
feat: initial implementation of XMSS hash-sig in pure zig
2 parents d659a81 + bb6ce21 commit 3bf7d57

File tree

20 files changed

+2005
-12
lines changed

20 files changed

+2005
-12
lines changed

.github/workflows/README.md

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# GitHub Actions Workflows
2+
3+
## CI Workflow
4+
5+
The `ci.yml` workflow runs on every push or pull request to `main`, `master`, or `develop` branches.
6+
7+
### Jobs
8+
9+
#### 1. Lint
10+
- **Runs on:** Ubuntu Latest
11+
- **Zig Version:** 0.14.1
12+
- **Steps:**
13+
- Checkout code
14+
- Setup Zig
15+
- Run `zig build lint` (using zlinter)
16+
17+
#### 2. Test
18+
- **Runs on:** Ubuntu, macOS, Windows
19+
- **Zig Version:** 0.14.1
20+
- **Matrix Strategy:** Tests on 3 platforms
21+
- **Steps:**
22+
- Checkout code
23+
- Setup Zig
24+
- Run `zig build test`
25+
- Build library with `zig build`
26+
27+
#### 3. Build Examples
28+
- **Runs on:** Ubuntu Latest
29+
- **Zig Version:** 0.14.1
30+
- **Dependencies:** Runs after lint and test jobs succeed
31+
- **Steps:**
32+
- Build library
33+
- Run example application
34+
35+
### Trigger Events
36+
37+
The workflow triggers on:
38+
- **Push** to main, master, or develop branches
39+
- **Pull requests** targeting main, master, or develop branches
40+
41+
### Badge
42+
43+
The CI status badge in README.md:
44+
45+
```markdown
46+
[![CI](https://github.com/ch4r10t33r/hash-zig/actions/workflows/ci.yml/badge.svg)](https://github.com/ch4r10t33r/hash-zig/actions/workflows/ci.yml)
47+
```
48+
49+
### Local Testing
50+
51+
Before pushing, you can run the same checks locally with Zig 0.14.1:
52+
53+
```bash
54+
# Run linting
55+
zig build lint
56+
57+
# Run tests
58+
zig build test
59+
60+
# Build library
61+
zig build
62+
63+
# Run example
64+
zig build example
65+
```
66+
67+
### Supported Zig Version
68+
69+
- **0.14.1** - Required version (zlinter only supports 0.14.x)
70+
71+
**Note:** The project uses zlinter which currently only supports Zig 0.14.x. Once zlinter adds support for Zig 0.15+, the CI will be updated.
72+
73+
### Platform Support
74+
75+
- **Linux** (Ubuntu Latest)
76+
- **macOS** (macOS Latest)
77+
- **Windows** (Windows Latest)
78+
79+
All tests must pass on all platforms before merging to protected branches.
80+
81+
### Linter (zlinter)
82+
83+
The project uses [zlinter](https://github.com/kurtwagner/zlinter) - an extendable Zig linter integrated into the build system.
84+
85+
**Enabled rules:**
86+
- `field_naming` - Enforce field naming conventions
87+
- `declaration_naming` - Enforce declaration naming conventions (snake_case)
88+
- `function_naming` - Enforce function naming conventions
89+
- `no_unused` - Detect unused declarations
90+
- `no_deprecated` - Warn about deprecated API usage
91+
92+
**Customization:**
93+
See `build.zig` to add/remove rules or adjust severity levels.

.github/workflows/ci.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
- develop
9+
pull_request:
10+
branches:
11+
- main
12+
- master
13+
- develop
14+
15+
jobs:
16+
lint:
17+
name: Lint
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- name: Checkout code
22+
uses: actions/checkout@v4
23+
24+
- name: Setup Zig
25+
uses: goto-bus-stop/setup-zig@v2
26+
with:
27+
version: 0.14.1
28+
29+
- name: Verify Zig installation
30+
run: zig version
31+
32+
- name: Run lint
33+
run: zig build lint
34+
35+
test:
36+
name: Test
37+
runs-on: ${{ matrix.os }}
38+
strategy:
39+
matrix:
40+
os: [ubuntu-latest, macos-latest, windows-latest]
41+
42+
steps:
43+
- name: Checkout code
44+
uses: actions/checkout@v4
45+
46+
- name: Setup Zig
47+
uses: goto-bus-stop/setup-zig@v2
48+
with:
49+
version: 0.14.1
50+
51+
- name: Verify Zig installation
52+
run: zig version
53+
54+
- name: Run tests
55+
run: zig build test
56+
57+
- name: Build library
58+
run: zig build
59+
60+
build-examples:
61+
name: Build Examples
62+
runs-on: ubuntu-latest
63+
needs: [lint, test]
64+
65+
steps:
66+
- name: Checkout code
67+
uses: actions/checkout@v4
68+
69+
- name: Setup Zig
70+
uses: goto-bus-stop/setup-zig@v2
71+
with:
72+
version: 0.14.1
73+
74+
- name: Build library
75+
run: zig build-lib src/root.zig --name hash_zig

.gitignore

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Zig build artifacts
2+
zig-cache/
3+
zig-out/
4+
.zig-cache/
5+
6+
# Build outputs
7+
*.o
8+
*.so
9+
*.a
10+
*.dylib
11+
*.dll
12+
*.lib
13+
*.exe
14+
15+
# Editor and IDE files
16+
.vscode/
17+
.idea/
18+
*.swp
19+
*.swo
20+
*~
21+
.DS_Store
22+
23+
# Test artifacts
24+
test_*
25+
*.test
26+
27+
# Temporary files
28+
tmp/
29+
temp/
30+
*.tmp
31+
32+
# Logs
33+
*.log
34+
35+
# Documentation build artifacts
36+
docs/
37+
site/
38+
39+
# OS-specific files
40+
Thumbs.db
41+
desktop.ini
42+
43+
# Backup files
44+
*.bak
45+
*.backup
46+
47+
# Lock files (keep .lock files for reproducible builds)
48+
# Uncomment if you want to ignore lock files:
49+
# *.lock
50+
51+
# Local configuration
52+
config.local.*
53+
.env
54+
.env.local
55+
56+
# Coverage reports
57+
coverage/
58+
*.profdata
59+
*.profraw

0 commit comments

Comments
 (0)