A maildir and Maildir++ library for Zig 0.16: delivery, flags, folders and quota.
2.9 kB
78 lines
1# SPDX-FileCopyrightText: © 2026 Jeffrey C. Ollie <jeff@ocjtech.us>
2# SPDX-License-Identifier: MIT
3
4name: test
5
6on:
7 push:
8 workflow_dispatch:
9
10jobs:
11 test:
12 runs-on: nixos-do-s
13 steps:
14 - name: Check out
15 uses: https://code.forgejo.org/actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
16
17 - name: Check REUSE compliance
18 run: nix develop -c reuse lint
19
20 # `zig-pkg` is where Zig puts fetched dependencies, and it is full of
21 # other people's source. It does not exist yet on a fresh checkout, but
22 # it does as soon as anything has been built, so excluding it is what
23 # makes this command mean the same thing here and on a developer's
24 # machine.
25 - name: Check Zig formatting compliance
26 run: nix develop -c zig fmt --check --exclude zig-pkg .
27
28 - name: Test
29 run: nix develop -c zig build test --summary all
30
31 - name: Build
32 run: nix develop -c zig build
33
34 # Nothing else builds the fuzz driver or the docs server, so without
35 # this they could stop compiling and the test step would not notice.
36 - name: Build everything that is not built by the steps above
37 run: nix develop -c zig build check
38
39 # Bounded by a count rather than a clock so that the run is the same on
40 # every machine, and short because this is here to catch a property that
41 # a change has made false rather than to search: a real campaign is
42 # `zig build fuzz-run -- --seconds 600` on somebody's own machine.
43 - name: Fuzz the parsers
44 run: nix develop -c zig build fuzz-run -- --iterations 500000
45
46 # The interoperability test boots a NixOS guest to run a real Dovecot
47 # against a maildir this library wrote, so it needs a runner that can nest
48 # virtualisation. The ephemeral DigitalOcean tiers can; the always-on one
49 # deliberately cannot.
50 interop:
51 runs-on: nixos-do-s
52 steps:
53 - name: Check out
54 uses: https://code.forgejo.org/actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
55
56 - name: Dovecot reads what this library writes
57 run: nix flake check --print-build-logs
58
59 # Published only from main, so that a branch build cannot replace the site
60 # with a work in progress, and only after `test` has passed, so that it
61 # cannot document a tree that does not compile.
62 docs:
63 needs: test
64 if: ${{ forge.ref == 'refs/heads/main' }}
65 runs-on: nixos-do-s
66 steps:
67 - name: Check out
68 uses: https://code.forgejo.org/actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
69
70 - name: Build API docs
71 run: nix develop -c zig build docs
72
73 - name: Publish docs
74 run: >
75 nix develop -c git-pages-cli https://jeff.jcollie.page/zig-maildir/
76 --server jcollie.page
77 --token ${{ forge.token }}
78 --upload-dir zig-out/docs