Skip to content

Commit c1838be

Browse files
committed
Merge #225: Improve and document act support
4e3f8fa doc: add instructions for using act (Sjors Provoost) 81712ff ci: disable KVM and sandbox inside act containers (Sjors Provoost) Pull request description: Facilitate using [act](https://github.com/nektos/act) with Docker / Podman as an alternative for using nix directly. I found this very useful for testing the sanitizer job against individual commits in #222. That is, once I finally got it to work... This disables `sandbox` and `filter-syscalls` (but not in the CI environment), which seems fine given that anyone building this code on their own machine has to trust it anyway. ACKs for top commit: ryanofsky: Code review ACK 4e3f8fa. Nice changes, and sorry for not reviewing this earlier. This seems like a useful feature and I plan to use it myself to test githuba ctions changes. Setting up the `/nix` subvolume in the instructions is also really nice since it should enable builds to run really quickly. Tree-SHA512: 0f18f1ce5662003c042099d2804af8c3b1867940c5db96fad63bad79c42d0c47503dd6c7a1e9b30092051e6fdd574b9e650f0ee0161dcca076b4819540876975
2 parents a173f17 + 4e3f8fa commit c1838be

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,11 @@ jobs:
7676
build:
7777
runs-on: ubuntu-latest
7878

79+
env:
80+
NIX_EXTRA_CONFIG_ACT: |
81+
sandbox = false
82+
filter-syscalls = false
83+
7984
strategy:
8085
fail-fast: false
8186
matrix:
@@ -90,6 +95,10 @@ jobs:
9095
uses: cachix/install-nix-action@v31 # 2025-05-27, from https://github.com/cachix/install-nix-action/tags
9196
with:
9297
nix_path: nixpkgs=channel:nixos-25.05 # latest release
98+
# Act executes inside an unprivileged container (Docker or Podman),
99+
# so KVM support isn't available.
100+
enable_kvm: "${{ github.actor != 'nektos/act' }}"
101+
extra_nix_config: ${{ github.actor == 'nektos/act' && env.NIX_EXTRA_CONFIG_ACT || '' }}
93102

94103
- name: Run CI script
95104
env:

ci/README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,29 @@ CI_CONFIG=ci/configs/olddeps.bash ci/scripts/run.sh
2424
```
2525

2626
By default CI jobs will reuse their build directories. `CI_CLEAN=1` can be specified to delete them before running instead.
27+
28+
### Running workflows with `act`
29+
30+
You can run either the entire workflow or a single matrix entry locally. On
31+
macOS or Linux:
32+
33+
1. Install [`act`](https://github.com/nektos/act) and either Docker or
34+
Podman.
35+
2. Inside the Podman VM, create a named volume for the Nix store (ext4,
36+
case-sensitive) so builds persist across runs. Recreate it any time you want
37+
a clean cache:
38+
```bash
39+
podman volume create libmultiprocess-nix
40+
```
41+
3. From the repo root, launch the workflow. The example below targets the
42+
sanitize matrix entry; drop the `--matrix` flag to run every configuration.
43+
```bash
44+
act \
45+
--reuse \
46+
-P ubuntu-latest=ghcr.io/catthehacker/ubuntu:act-24.04 \
47+
--container-options "-v libmultiprocess-nix:/nix" \
48+
-j build \
49+
--matrix config:sanitize
50+
```
51+
52+

0 commit comments

Comments
 (0)