summaryrefslogtreecommitdiffstats
path: root/.github/workflows/ci.yml
blob: be0a1646c10c081ea218a9252c72956704b1b76a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
name: CI

on: [push, pull_request]

jobs:
  linux:
    name: Linux

    runs-on: ubuntu-24.04

    steps:
      - uses: actions/checkout@v4

      - name: Install dependencies
        run: |
          sudo dpkg --add-architecture i386
          sudo apt-get update -y
          sudo apt-get install -y \
              expect \
              gcc-multilib \
              libgcc-s1:i386 \
              acl \
              libacl1-dev \
              libacl1:i386 \
              attr \
              libcap2-bin \
              libcap-dev \
              libcap2:i386 \
              libonig-dev \
              libonig5:i386 \
              liburing-dev
          # Ubuntu doesn't let you install the -dev packages for both amd64 and
          # i386 at once, so we make our own symlinks to fix -m32 -lacl -l...
          sudo ln -s libacl.so.1 /lib/i386-linux-gnu/libacl.so
          sudo ln -s libcap.so.2 /lib/i386-linux-gnu/libcap.so
          sudo ln -s libonig.so.5 /lib/i386-linux-gnu/libonig.so
          # Work around https://github.com/actions/runner-images/issues/9491
          sudo sysctl vm.mmap_rnd_bits=28

      - name: Run tests
        run: |
          .github/diag.sh make -j$(nproc) distcheck

      - uses: actions/upload-artifact@v4
        with:
          name: linux-config.log
          path: distcheck-*/gen/config.log

  macos:
    name: macOS

    runs-on: macos-14

    steps:
      - uses: actions/checkout@v4

      - name: Install dependencies
        run: |
          brew install \
              bash \
              expect

      - name: Run tests
        run: |
          jobs=$(sysctl -n hw.ncpu)
          .github/diag.sh make -j$jobs distcheck

  freebsd:
    name: FreeBSD

    runs-on: ubuntu-24.04

    steps:
      - uses: actions/checkout@v4

      - name: Run tests
        uses: cross-platform-actions/action@v0.25.0
        with:
          operating_system: freebsd
          version: "14.1"

          run: |
            sudo pkg install -y \
                bash \
                expect \
                oniguruma \
                pkgconf \
                tcl-wrapper
            sudo mount -t fdescfs none /dev/fd
            .github/diag.sh make -j$(nproc) distcheck

      - uses: actions/upload-artifact@v4
        with:
          name: freebsd-config.log
          path: distcheck-*/gen/config.log

  openbsd:
    name: OpenBSD

    runs-on: ubuntu-24.04

    steps:
      - uses: actions/checkout@v4

      - name: Run tests
        uses: cross-platform-actions/action@v0.25.0
        with:
          operating_system: openbsd
          version: "7.5"

          run: |
            sudo pkg_add \
                bash \
                expect \
                gmake \
                oniguruma
            jobs=$(sysctl -n hw.ncpu)
            ./configure MAKE=gmake
            .github/diag.sh gmake -j$jobs check TEST_FLAGS="--sudo --verbose=skipped"

      - uses: actions/upload-artifact@v4
        with:
          name: openbsd-config.log
          path: gen/config.log

  netbsd:
    name: NetBSD

    runs-on: ubuntu-24.04

    steps:
      - uses: actions/checkout@v4

      - name: Run tests
        uses: cross-platform-actions/action@v0.25.0
        with:
          operating_system: netbsd
          version: "10.0"

          run: |
            PATH="/sbin:/usr/sbin:$PATH"
            sudo pkgin -y install \
                bash \
                oniguruma \
                pkgconf \
                tcl-expect
            jobs=$(sysctl -n hw.ncpu)
            ./configure
            .github/diag.sh make -j$jobs check TEST_FLAGS="--sudo --verbose=skipped"

      - uses: actions/upload-artifact@v4
        with:
          name: netbsd-config.log
          path: gen/config.log

  dragonflybsd:
    name: DragonFly BSD

    runs-on: ubuntu-24.04

    steps:
      - uses: actions/checkout@v4

      # Work around https://github.com/vmactions/freebsd-vm/issues/83
      - name: Fix pip
        run: |
          sudo rm /usr/lib/python3.12/EXTERNALLY-MANAGED

      - name: Run tests
        uses: vmactions/dragonflybsd-vm@v1
        with:
          release: "6.4.0"
          usesh: true

          prepare: |
            pkg install -y \
                bash \
                expect \
                oniguruma \
                pkgconf \
                sudo \
                tcl-wrapper
            pw useradd -n action -m -G wheel -s /usr/local/bin/bash
            echo "%wheel ALL=(ALL) NOPASSWD: ALL" >>/usr/local/etc/sudoers

          run: |
            chown -R action:action .
            jobs=$(sysctl -n hw.ncpu)
            sudo -u action ./configure
            sudo -u action .github/diag.sh make -j$jobs check TEST_FLAGS="--sudo --verbose=skipped"

      - uses: actions/upload-artifact@v4
        with:
          name: dragonfly-config.log
          path: gen/config.log

  omnios:
    name: OmniOS

    runs-on: ubuntu-24.04

    steps:
      - uses: actions/checkout@v4

      # Work around https://github.com/vmactions/freebsd-vm/issues/83
      - name: Fix pip
        run: |
          sudo rm /usr/lib/python3.12/EXTERNALLY-MANAGED

      - name: Run tests
        uses: vmactions/omnios-vm@v1
        with:
          release: "r151048"
          usesh: true

          prepare: |
            pkg install \
                bash \
                build-essential \
                expect \
                gnu-make \
                onig \
                sudo
            useradd -m -g staff action
            echo "%staff ALL=(ALL) NOPASSWD: ALL" >>/etc/sudoers

          run: |
            PATH="/usr/xpg4/bin:$PATH"
            chown -R action:staff .
            jobs=$(getconf NPROCESSORS_ONLN)
            sudo -u action ./configure MAKE=gmake
            sudo -u action .github/diag.sh gmake -j$jobs check TEST_FLAGS="--sudo --verbose=skipped"

      - uses: actions/upload-artifact@v4
        with:
          name: omnios-config.log
          path: gen/config.log