Skip to content

Commit e32489f

Browse files
committed
ci: update workflows and add module doc to class.zig
1 parent fcecc53 commit e32489f

3 files changed

Lines changed: 34 additions & 6 deletions

File tree

.github/workflows/docs.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ name: Deploy docs
33
on:
44
push:
55
branches: ["dev"]
6+
paths:
7+
- "src/**"
8+
- "build.zig"
9+
- "build.zig.zon"
10+
- ".github/workflows/docs.yml"
611
workflow_dispatch:
712

813
permissions:
@@ -27,9 +32,10 @@ jobs:
2732
uses: actions/configure-pages@v3
2833
- uses: mlugg/setup-zig@v2
2934
- name: Install PHP development headers
30-
run: |
31-
sudo apt-get update
32-
sudo apt-get install -y php-dev
35+
uses: awalsh128/cache-apt-pkgs-action@latest
36+
with:
37+
packages: php-dev
38+
version: 1.0
3339
- name: Generate docs
3440
run: |
3541
PHP_INCLUDE_DIR=$(php-config --include-dir)

.github/workflows/test.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,18 @@ name: Test
33
on:
44
push:
55
branches: ["dev"]
6+
paths:
7+
- "src/**"
8+
- "build.zig"
9+
- "build.zig.zon"
10+
- ".github/workflows/test.yml"
611
pull_request:
712
branches: ["dev"]
13+
paths:
14+
- "src/**"
15+
- "build.zig"
16+
- "build.zig.zon"
17+
- ".github/workflows/test.yml"
818
workflow_dispatch:
919

1020
jobs:
@@ -15,9 +25,10 @@ jobs:
1525
uses: actions/checkout@v4
1626
- uses: mlugg/setup-zig@v2
1727
- name: Install PHP development headers
18-
run: |
19-
sudo apt-get update
20-
sudo apt-get install -y php-dev
28+
uses: awalsh128/cache-apt-pkgs-action@latest
29+
with:
30+
packages: php-dev
31+
version: 1.0
2132
- name: Run tests
2233
run: |
2334
PHP_INCLUDE_DIR=$(php-config --include-dir)

src/class.zig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
//! PHP class registration and object lifecycle management.
2+
//!
3+
//! This module provides utilities for creating PHP classes from Zig types:
4+
//!
5+
//! - `Class`: Full-featured class wrapper with Zig data binding and lifecycle management
6+
//! - `DerivedClass`: Lightweight class registration for derived classes without custom data
7+
//!
8+
//! Both functions generate class wrappers that integrate with PHP's object system,
9+
//! handling registration through auto-generated `register_class_*` functions from
10+
//! PHP stub files.
11+
112
/// Create a PHP class wrapper around a Zig type.
213
///
314
/// This function generates a wrapper structure that bridges Zig code with PHP's

0 commit comments

Comments
 (0)