xref: /freebsd/crypto/openssh/.github/workflows/vm.yml (revision 644b4646c7acab87dc20d4e5dd53d2d9da152989)
1*644b4646SEd Maste# For testing, you can set variables in your repo (Repo -> Settings ->
2*644b4646SEd Maste# Security -> Actions -> Variables) to restrict the tests that are run
3*644b4646SEd Maste# The supported variables are:
4*644b4646SEd Maste#
5*644b4646SEd Maste# RUN_ONLY_TARGET_CONFIG: Run only the single matching target and config,
6*644b4646SEd Maste#   separated by spaces, eg "ubuntu-latest default".  All other tests will
7*644b4646SEd Maste#   fail immediately.
8*644b4646SEd Maste#
9*644b4646SEd Maste# LTESTS: Override the set of tests run.
10*644b4646SEd Maste
11*644b4646SEd Mastename: CI VM
12*644b4646SEd Masteon:
13*644b4646SEd Maste  push:
14*644b4646SEd Maste    paths: [ '**.c', '**.h', '**.m4', '**.sh', '**/Makefile.in', 'configure.ac', '.github/configs', '.github/workflows/vm.yml' ]
15*644b4646SEd Maste  pull_request:
16*644b4646SEd Maste    paths: [ '**.c', '**.h', '**.m4', '**.sh', '**/Makefile.in', 'configure.ac', '.github/configs', '.github/workflows/vm.yml' ]
17*644b4646SEd Maste
18*644b4646SEd Mastejobs:
19*644b4646SEd Maste  dragonflybsd:
20*644b4646SEd Maste    name: "dragonflybsd-${{ matrix.target }}"
21*644b4646SEd Maste    if: github.repository != 'openssh/openssh-portable-selfhosted'
22*644b4646SEd Maste    strategy:
23*644b4646SEd Maste      fail-fast: false
24*644b4646SEd Maste      matrix:
25*644b4646SEd Maste        # First we test all OSes in the default configuration.
26*644b4646SEd Maste        target:
27*644b4646SEd Maste          - "6.4.2"
28*644b4646SEd Maste        config: [default]
29*644b4646SEd Maste    runs-on: ubuntu-latest
30*644b4646SEd Maste    steps:
31*644b4646SEd Maste    - uses: actions/checkout@main
32*644b4646SEd Maste    - name: autoreconf
33*644b4646SEd Maste      run: sh -c autoreconf
34*644b4646SEd Maste
35*644b4646SEd Maste    - name: start DragonFlyBSD ${{ matrix.target }} VM
36*644b4646SEd Maste      uses: vmactions/dragonflybsd-vm@v1
37*644b4646SEd Maste      with:
38*644b4646SEd Maste        release: ${{ matrix.target }}
39*644b4646SEd Maste        usesh: true
40*644b4646SEd Maste        prepare: |
41*644b4646SEd Maste          pkg install -y sudo
42*644b4646SEd Maste          pw useradd builder -m
43*644b4646SEd Maste          echo "builder ALL=(ALL:ALL) NOPASSWD: ALL" >>/usr/local/etc/sudoers
44*644b4646SEd Maste          mkdir -p /var/empty /usr/local/etc
45*644b4646SEd Maste          cp $GITHUB_WORKSPACE/moduli /usr/local/etc/moduli
46*644b4646SEd Maste
47*644b4646SEd Maste    - name: set file perms
48*644b4646SEd Maste      shell: dragonflybsd {0}
49*644b4646SEd Maste      run: cd $GITHUB_WORKSPACE && chown -R builder .
50*644b4646SEd Maste    - name: configure
51*644b4646SEd Maste      shell: dragonflybsd {0}
52*644b4646SEd Maste      run: cd $GITHUB_WORKSPACE && sudo -u builder ./configure --with-ssl-dir=/usr/local
53*644b4646SEd Maste    - name: make clean
54*644b4646SEd Maste      shell: dragonflybsd {0}
55*644b4646SEd Maste      run: cd $GITHUB_WORKSPACE && sudo -u builder make clean
56*644b4646SEd Maste    - name: make
57*644b4646SEd Maste      shell: dragonflybsd {0}
58*644b4646SEd Maste      run: cd $GITHUB_WORKSPACE && sudo -u builder make -j4
59*644b4646SEd Maste    - name: make tests
60*644b4646SEd Maste      shell: dragonflybsd {0}
61*644b4646SEd Maste      run: |
62*644b4646SEd Maste        cd $GITHUB_WORKSPACE
63*644b4646SEd Maste        sudo -u builder env SUDO=sudo make tests
64*644b4646SEd Maste
65*644b4646SEd Maste    - name: "PAM: configure"
66*644b4646SEd Maste      shell: dragonflybsd {0}
67*644b4646SEd Maste      run: cd $GITHUB_WORKSPACE && sudo -u builder ./configure --with-ssl-dir=/usr/local --with-pam
68*644b4646SEd Maste    - name: "PAM: make clean"
69*644b4646SEd Maste      shell: dragonflybsd {0}
70*644b4646SEd Maste      run: cd $GITHUB_WORKSPACE && sudo -u builder make clean
71*644b4646SEd Maste    - name: "PAM: make"
72*644b4646SEd Maste      shell: dragonflybsd {0}
73*644b4646SEd Maste      run: cd $GITHUB_WORKSPACE && sudo -u builder make -j4
74*644b4646SEd Maste    - name: "PAM: make tests"
75*644b4646SEd Maste      shell: dragonflybsd {0}
76*644b4646SEd Maste      run: |
77*644b4646SEd Maste        cd $GITHUB_WORKSPACE
78*644b4646SEd Maste        sudo -u builder env SUDO=sudo SSHD_CONFOPTS="UsePam yes" make tests
79*644b4646SEd Maste
80*644b4646SEd Maste  freebsd:
81*644b4646SEd Maste    name: "freebsd-${{ matrix.target }}"
82*644b4646SEd Maste    if: github.repository != 'openssh/openssh-portable-selfhosted'
83*644b4646SEd Maste    strategy:
84*644b4646SEd Maste      fail-fast: false
85*644b4646SEd Maste      matrix:
86*644b4646SEd Maste        # First we test all OSes in the default configuration.
87*644b4646SEd Maste        target:
88*644b4646SEd Maste          - "13.5"
89*644b4646SEd Maste          - "14.3"
90*644b4646SEd Maste          # - "15.0" # "pkg" breaks with a libutil.so error...
91*644b4646SEd Maste        config: [default]
92*644b4646SEd Maste    runs-on: ubuntu-latest
93*644b4646SEd Maste    steps:
94*644b4646SEd Maste    - uses: actions/checkout@main
95*644b4646SEd Maste    - name: autoreconf
96*644b4646SEd Maste      run: sh -c autoreconf
97*644b4646SEd Maste
98*644b4646SEd Maste    - name: start FreeBSD ${{ matrix.target }} VM
99*644b4646SEd Maste      uses: vmactions/freebsd-vm@v1
100*644b4646SEd Maste      with:
101*644b4646SEd Maste        release: ${{ matrix.target }}
102*644b4646SEd Maste        usesh: true
103*644b4646SEd Maste        prepare: |
104*644b4646SEd Maste          pkg install -y sudo
105*644b4646SEd Maste          pw useradd builder -m
106*644b4646SEd Maste          echo "builder ALL=(ALL:ALL) NOPASSWD: ALL" >>/usr/local/etc/sudoers
107*644b4646SEd Maste          mkdir -p /var/empty /usr/local/etc
108*644b4646SEd Maste          cp $GITHUB_WORKSPACE/moduli /usr/local/etc/moduli
109*644b4646SEd Maste
110*644b4646SEd Maste    - name: set file perms
111*644b4646SEd Maste      shell: freebsd {0}
112*644b4646SEd Maste      run: cd $GITHUB_WORKSPACE && chown -R builder .
113*644b4646SEd Maste    - name: configure
114*644b4646SEd Maste      shell: freebsd {0}
115*644b4646SEd Maste      run: cd $GITHUB_WORKSPACE && sudo -u builder ./configure
116*644b4646SEd Maste    - name: make clean
117*644b4646SEd Maste      shell: freebsd {0}
118*644b4646SEd Maste      run: cd $GITHUB_WORKSPACE && sudo -u builder make clean
119*644b4646SEd Maste    - name: make
120*644b4646SEd Maste      shell: freebsd {0}
121*644b4646SEd Maste      run: cd $GITHUB_WORKSPACE && sudo -u builder make -j4
122*644b4646SEd Maste    - name: make tests
123*644b4646SEd Maste      shell: freebsd {0}
124*644b4646SEd Maste      run: |
125*644b4646SEd Maste        cd $GITHUB_WORKSPACE
126*644b4646SEd Maste        sudo -u builder env SUDO=sudo make tests
127*644b4646SEd Maste
128*644b4646SEd Maste    - name: "PAM: configure"
129*644b4646SEd Maste      shell: freebsd {0}
130*644b4646SEd Maste      run: cd $GITHUB_WORKSPACE && sudo -u builder ./configure --with-pam
131*644b4646SEd Maste    - name: "PAM: make clean"
132*644b4646SEd Maste      shell: freebsd {0}
133*644b4646SEd Maste      run: cd $GITHUB_WORKSPACE && sudo -u builder make clean
134*644b4646SEd Maste    - name: "PAM: make"
135*644b4646SEd Maste      shell: freebsd {0}
136*644b4646SEd Maste      run: cd $GITHUB_WORKSPACE && sudo -u builder make -j4
137*644b4646SEd Maste    - name: "PAM: make tests"
138*644b4646SEd Maste      shell: freebsd {0}
139*644b4646SEd Maste      run: |
140*644b4646SEd Maste        cd $GITHUB_WORKSPACE
141*644b4646SEd Maste        sudo -u builder env SUDO=sudo SSHD_CONFOPTS="UsePam yes" make tests
142*644b4646SEd Maste
143*644b4646SEd Maste
144*644b4646SEd Maste  netbsd:
145*644b4646SEd Maste    name: "netbsd-${{ matrix.target }}"
146*644b4646SEd Maste    if: github.repository != 'openssh/openssh-portable-selfhosted'
147*644b4646SEd Maste    strategy:
148*644b4646SEd Maste      fail-fast: false
149*644b4646SEd Maste      matrix:
150*644b4646SEd Maste        # First we test all OSes in the default configuration.
151*644b4646SEd Maste        target:
152*644b4646SEd Maste          - "9.0"
153*644b4646SEd Maste          - "9.4"
154*644b4646SEd Maste          - "10.0"
155*644b4646SEd Maste          - "10.1"
156*644b4646SEd Maste        config: [default]
157*644b4646SEd Maste    runs-on: ubuntu-latest
158*644b4646SEd Maste    steps:
159*644b4646SEd Maste    - uses: actions/checkout@main
160*644b4646SEd Maste    - name: autoreconf
161*644b4646SEd Maste      run: sh -c autoreconf
162*644b4646SEd Maste
163*644b4646SEd Maste    - name: start NetBSD ${{ matrix.target }} VM
164*644b4646SEd Maste      uses: vmactions/netbsd-vm@v1
165*644b4646SEd Maste      with:
166*644b4646SEd Maste        release: ${{ matrix.target }}
167*644b4646SEd Maste        usesh: true
168*644b4646SEd Maste        prepare: |
169*644b4646SEd Maste          /usr/sbin/pkg_add sudo
170*644b4646SEd Maste          /usr/sbin/useradd -m builder
171*644b4646SEd Maste          echo "builder ALL=(ALL:ALL) NOPASSWD: ALL" >>/usr/pkg/etc/sudoers
172*644b4646SEd Maste          mkdir -p /var/empty /usr/local/etc
173*644b4646SEd Maste          cp $GITHUB_WORKSPACE/moduli /usr/local/etc/moduli
174*644b4646SEd Maste
175*644b4646SEd Maste    - name: set file perms
176*644b4646SEd Maste      shell: netbsd {0}
177*644b4646SEd Maste      run: cd $GITHUB_WORKSPACE && /sbin/chown -R builder .
178*644b4646SEd Maste    - name: configure
179*644b4646SEd Maste      shell: netbsd {0}
180*644b4646SEd Maste      run: cd $GITHUB_WORKSPACE && sudo -u builder ./configure
181*644b4646SEd Maste    - name: make clean
182*644b4646SEd Maste      shell: netbsd {0}
183*644b4646SEd Maste      run: cd $GITHUB_WORKSPACE && sudo -u builder make clean
184*644b4646SEd Maste    - name: make
185*644b4646SEd Maste      shell: netbsd {0}
186*644b4646SEd Maste      run: cd $GITHUB_WORKSPACE && sudo -u builder make -j4
187*644b4646SEd Maste    - name: make tests
188*644b4646SEd Maste      shell: netbsd {0}
189*644b4646SEd Maste      run: |
190*644b4646SEd Maste        cd $GITHUB_WORKSPACE
191*644b4646SEd Maste        sudo -u builder env SUDO=sudo make tests
192*644b4646SEd Maste
193*644b4646SEd Maste    - name: "PAM: configure"
194*644b4646SEd Maste      shell: netbsd {0}
195*644b4646SEd Maste      run: cd $GITHUB_WORKSPACE && sudo -u builder ./configure --with-pam
196*644b4646SEd Maste    - name: "PAM: make clean"
197*644b4646SEd Maste      shell: netbsd {0}
198*644b4646SEd Maste      run: cd $GITHUB_WORKSPACE && sudo -u builder make clean
199*644b4646SEd Maste    - name: "PAM: make"
200*644b4646SEd Maste      shell: netbsd {0}
201*644b4646SEd Maste      run: cd $GITHUB_WORKSPACE && sudo -u builder make -j4
202*644b4646SEd Maste    - name: "PAM: make tests"
203*644b4646SEd Maste      shell: netbsd {0}
204*644b4646SEd Maste      run: |
205*644b4646SEd Maste        cd $GITHUB_WORKSPACE
206*644b4646SEd Maste        sudo -u builder env SUDO=sudo SSHD_CONFOPTS="UsePam yes" make tests
207*644b4646SEd Maste
208*644b4646SEd Maste
209*644b4646SEd Maste  ominios:
210*644b4646SEd Maste    name: "omnios-${{ matrix.target }}"
211*644b4646SEd Maste    if: github.repository != 'openssh/openssh-portable-selfhosted'
212*644b4646SEd Maste    strategy:
213*644b4646SEd Maste      fail-fast: false
214*644b4646SEd Maste      matrix:
215*644b4646SEd Maste        # First we test all OSes in the default configuration.
216*644b4646SEd Maste        target:
217*644b4646SEd Maste          - "r151054"
218*644b4646SEd Maste        config: [default]
219*644b4646SEd Maste    runs-on: ubuntu-latest
220*644b4646SEd Maste    steps:
221*644b4646SEd Maste    - uses: actions/checkout@main
222*644b4646SEd Maste    - name: autoreconf
223*644b4646SEd Maste      run: sh -c autoreconf
224*644b4646SEd Maste
225*644b4646SEd Maste    - name: start OmniOS ${{ matrix.target }} VM
226*644b4646SEd Maste      uses: vmactions/omnios-vm@v1
227*644b4646SEd Maste      with:
228*644b4646SEd Maste        release: ${{ matrix.target }}
229*644b4646SEd Maste        usesh: true
230*644b4646SEd Maste        prepare: |
231*644b4646SEd Maste          set -x
232*644b4646SEd Maste          pfexec pkg refresh
233*644b4646SEd Maste          pfexec pkg install build-essential
234*644b4646SEd Maste          useradd -m builder
235*644b4646SEd Maste          sed -e "s/^root.*ALL$/root ALL=(ALL) NOPASSWD: ALL/" /etc/sudoers >>/tmp/sudoers
236*644b4646SEd Maste          mv /tmp/sudoers /etc/sudoers
237*644b4646SEd Maste          echo "builder ALL=(ALL) NOPASSWD: ALL" >>/etc/sudoers
238*644b4646SEd Maste          mkdir -p /var/empty /usr/local/etc
239*644b4646SEd Maste          cp $GITHUB_WORKSPACE/moduli /usr/local/etc/moduli
240*644b4646SEd Maste
241*644b4646SEd Maste    - name: set file perms
242*644b4646SEd Maste      shell: omnios {0}
243*644b4646SEd Maste      run: cd $GITHUB_WORKSPACE && chown -R builder .
244*644b4646SEd Maste    - name: configure
245*644b4646SEd Maste      shell: omnios {0}
246*644b4646SEd Maste      run: cd $GITHUB_WORKSPACE && sudo -u builder ./configure
247*644b4646SEd Maste    - name: make clean
248*644b4646SEd Maste      shell: omnios {0}
249*644b4646SEd Maste      run: cd $GITHUB_WORKSPACE && sudo -u builder make clean
250*644b4646SEd Maste    - name: make
251*644b4646SEd Maste      shell: omnios {0}
252*644b4646SEd Maste      run: cd $GITHUB_WORKSPACE && sudo -u builder make
253*644b4646SEd Maste    - name: make tests
254*644b4646SEd Maste      shell: omnios {0}
255*644b4646SEd Maste      run: |
256*644b4646SEd Maste        cd $GITHUB_WORKSPACE
257*644b4646SEd Maste        sudo -u builder make tests
258*644b4646SEd Maste
259*644b4646SEd Maste
260*644b4646SEd Maste  openbsd:
261*644b4646SEd Maste    name: "openbsd-${{ matrix.target }}"
262*644b4646SEd Maste    if: github.repository != 'openssh/openssh-portable-selfhosted'
263*644b4646SEd Maste    strategy:
264*644b4646SEd Maste      fail-fast: false
265*644b4646SEd Maste      matrix:
266*644b4646SEd Maste        # First we test all OSes in the default configuration.
267*644b4646SEd Maste        target:
268*644b4646SEd Maste          - "7.3"
269*644b4646SEd Maste          - "7.5"
270*644b4646SEd Maste          - "7.6"
271*644b4646SEd Maste          - "7.7"
272*644b4646SEd Maste        config: [default]
273*644b4646SEd Maste    runs-on: ubuntu-latest
274*644b4646SEd Maste    steps:
275*644b4646SEd Maste    - uses: actions/checkout@main
276*644b4646SEd Maste    - name: autoreconf
277*644b4646SEd Maste      run: sh -c autoreconf
278*644b4646SEd Maste
279*644b4646SEd Maste    - name: start OpenBSD ${{ matrix.target }} VM
280*644b4646SEd Maste      uses: vmactions/openbsd-vm@v1
281*644b4646SEd Maste      with:
282*644b4646SEd Maste        release: ${{ matrix.target }}
283*644b4646SEd Maste        usesh: true
284*644b4646SEd Maste        prepare: |
285*644b4646SEd Maste          env PKG_PATH=https://ftp.openbsd.org/pub/OpenBSD/${{matrix.target}}/packages/amd64 pkg_add sudo--
286*644b4646SEd Maste          useradd -m builder
287*644b4646SEd Maste          echo "builder ALL=(ALL:ALL) NOPASSWD: ALL" >>/etc/sudoers
288*644b4646SEd Maste          mkdir -p /var/empty /usr/local/etc
289*644b4646SEd Maste          cp $GITHUB_WORKSPACE/moduli /usr/local/etc/moduli
290*644b4646SEd Maste
291*644b4646SEd Maste    - name: set file perms
292*644b4646SEd Maste      shell: openbsd {0}
293*644b4646SEd Maste      run: cd $GITHUB_WORKSPACE && chown -R builder .
294*644b4646SEd Maste    - name: configure
295*644b4646SEd Maste      shell: openbsd {0}
296*644b4646SEd Maste      run: cd $GITHUB_WORKSPACE && sudo -u builder ./configure
297*644b4646SEd Maste    - name: make clean
298*644b4646SEd Maste      shell: openbsd {0}
299*644b4646SEd Maste      run: cd $GITHUB_WORKSPACE && sudo -u builder make clean
300*644b4646SEd Maste    - name: make
301*644b4646SEd Maste      shell: openbsd {0}
302*644b4646SEd Maste      run: cd $GITHUB_WORKSPACE && sudo -u builder make -j4
303*644b4646SEd Maste    - name: make tests
304*644b4646SEd Maste      shell: openbsd {0}
305*644b4646SEd Maste      run: |
306*644b4646SEd Maste        cd $GITHUB_WORKSPACE
307*644b4646SEd Maste        sudo -u builder env SUDO=sudo make tests
308*644b4646SEd Maste
309*644b4646SEd Maste
310*644b4646SEd Maste  solaris:
311*644b4646SEd Maste    name: "solaris-${{ matrix.target }}"
312*644b4646SEd Maste    if: github.repository != 'openssh/openssh-portable-selfhosted'
313*644b4646SEd Maste    strategy:
314*644b4646SEd Maste      fail-fast: false
315*644b4646SEd Maste      matrix:
316*644b4646SEd Maste        # First we test all OSes in the default configuration.
317*644b4646SEd Maste        target:
318*644b4646SEd Maste          - "11.4-gcc"
319*644b4646SEd Maste        config: [default]
320*644b4646SEd Maste    runs-on: ubuntu-latest
321*644b4646SEd Maste    steps:
322*644b4646SEd Maste    - uses: actions/checkout@main
323*644b4646SEd Maste    - name: autoreconf
324*644b4646SEd Maste      run: sh -c autoreconf
325*644b4646SEd Maste
326*644b4646SEd Maste    - name: start Solaris ${{ matrix.target }} VM
327*644b4646SEd Maste      uses: vmactions/solaris-vm@v1
328*644b4646SEd Maste      with:
329*644b4646SEd Maste        release: ${{ matrix.target }}
330*644b4646SEd Maste        usesh: true
331*644b4646SEd Maste        prepare: |
332*644b4646SEd Maste          set -x
333*644b4646SEd Maste          useradd -m builder
334*644b4646SEd Maste          sed -e "s/^root.*ALL$/root ALL=(ALL) NOPASSWD: ALL/" /etc/sudoers >>/tmp/sudoers
335*644b4646SEd Maste          mv /tmp/sudoers /etc/sudoers
336*644b4646SEd Maste          echo "builder ALL=(ALL) NOPASSWD: ALL" >>/etc/sudoers
337*644b4646SEd Maste          mkdir -p /var/empty /usr/local/etc
338*644b4646SEd Maste          cp $GITHUB_WORKSPACE/moduli /usr/local/etc/moduli
339*644b4646SEd Maste
340*644b4646SEd Maste    - name: set file perms
341*644b4646SEd Maste      shell: solaris {0}
342*644b4646SEd Maste      run: cd $GITHUB_WORKSPACE && chown -R builder .
343*644b4646SEd Maste    - name: configure
344*644b4646SEd Maste      shell: solaris {0}
345*644b4646SEd Maste      run: cd $GITHUB_WORKSPACE && sudo -u builder ./configure
346*644b4646SEd Maste    - name: make clean
347*644b4646SEd Maste      shell: solaris {0}
348*644b4646SEd Maste      run: cd $GITHUB_WORKSPACE && sudo -u builder make clean
349*644b4646SEd Maste    - name: make
350*644b4646SEd Maste      shell: solaris {0}
351*644b4646SEd Maste      run: cd $GITHUB_WORKSPACE && sudo -u builder make
352*644b4646SEd Maste    - name: make tests
353*644b4646SEd Maste      shell: solaris {0}
354*644b4646SEd Maste      run: |
355*644b4646SEd Maste        cd $GITHUB_WORKSPACE
356*644b4646SEd Maste        sudo -u builder make tests
357*644b4646SEd Maste
358*644b4646SEd Maste    - name: "PAM: configure"
359*644b4646SEd Maste      shell: solaris {0}
360*644b4646SEd Maste      run: cd $GITHUB_WORKSPACE && sudo -u builder ./configure --with-pam
361*644b4646SEd Maste    - name: "PAM: make clean"
362*644b4646SEd Maste      shell: solaris {0}
363*644b4646SEd Maste      run: cd $GITHUB_WORKSPACE && sudo -u builder make clean
364*644b4646SEd Maste    - name: "PAM: make"
365*644b4646SEd Maste      shell: solaris {0}
366*644b4646SEd Maste      run: cd $GITHUB_WORKSPACE && sudo -u builder make
367*644b4646SEd Maste    - name: "PAM: make tests"
368*644b4646SEd Maste      shell: solaris {0}
369*644b4646SEd Maste      run: |
370*644b4646SEd Maste        cd $GITHUB_WORKSPACE
371*644b4646SEd Maste        sudo -u builder make tests
372