Skip to content

Commit b8c4811

Browse files
committed
add act
1 parent e29bc89 commit b8c4811

4 files changed

Lines changed: 41 additions & 0 deletions

File tree

.actrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
-W .github/workflows/ci.yml
2+
-P ubuntu-latest=catthehacker/ubuntu:act-latest
3+
-P macos-latest=catthehacker/ubuntu:act-latest
4+
-P windows-latest=catthehacker/ubuntu:act-latest
5+
--container-architecture linux/amd64

.mise.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
[tools]
2+
act = "latest"
23
deno = "latest"
34
go = "latest"
45
just = "latest"

Justfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,18 @@ ci:
5656
zig build test --summary all
5757
just e2e
5858

59+
# List CI workflow jobs as seen by `act`
60+
act-list:
61+
act -W .github/workflows/ci.yml -l
62+
63+
# Run GitHub Actions CI workflow locally with `act`
64+
act-ci event="pull_request":
65+
act {{ event }} -W .github/workflows/ci.yml
66+
67+
# Run a single CI job locally with `act` (example: `just act-ci-job test`)
68+
act-ci-job job event="pull_request":
69+
act {{ event }} -W .github/workflows/ci.yml -j {{ job }}
70+
5971
# Install to a local bin path (defaults to ~/.local/bin)
6072
install dest="${HOME}/.local/bin": release
6173
mkdir -p "{{ dest }}"

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ A pure Zig implementation of [Cap'n Proto](https://capnproto.org/) -- a serializ
2323
- Cap'n Proto compiler (`capnp`) - optional, for schema compilation
2424
- `mise` (recommended, for environment management)
2525
- `just` (recommended, for task automation)
26+
- Docker (optional, for local GitHub Actions runs via `act`)
2627

2728
### Building from Source
2829

@@ -329,6 +330,28 @@ zig build test-codegen # Codegen tests
329330
just e2e # Cross-language interop harness
330331
```
331332

333+
### Run GitHub Actions Locally
334+
335+
Use [`act`](https://github.com/nektos/act) to run `.github/workflows/ci.yml` on your machine.
336+
337+
```bash
338+
# Install toolchain declared in mise config (includes act)
339+
mise install
340+
341+
# List available CI jobs
342+
just act-list
343+
344+
# Run CI workflow locally (default event: pull_request)
345+
just act-ci
346+
347+
# Run a single job
348+
just act-ci-job test
349+
```
350+
351+
Notes:
352+
- The repo `.actrc` maps all matrix runner labels to a Linux container image for local execution.
353+
- Ensure Docker is running before invoking `act`.
354+
332355
### Test Coverage
333356

334357
- Message wire-format encode/decode, pointer resolution, limits, and malformed/fuzz inputs

0 commit comments

Comments
 (0)