1name: C/C++ CI self-hosted
2
3on:
4  push:
5    paths: [ '**.c', '**.h', '**.m4', '**.sh', '.github/**', '**/Makefile.in', 'configure.ac' ]
6
7jobs:
8  selfhosted:
9    if: github.repository == 'openssh/openssh-portable-selfhosted'
10    runs-on: ${{ matrix.host }}
11    timeout-minutes: 600
12    env:
13      HOST: ${{ matrix.host }}
14      TARGET_HOST: ${{ matrix.target }}
15      TARGET_CONFIG: ${{ matrix.config }}
16    strategy:
17      fail-fast: false
18      # We use a matrix in two parts: firstly all of the VMs are tested with the
19      # default config.  "target" corresponds to a label associated with the
20      # worker.  The default is an ephemeral VM running under libvirt.
21      matrix:
22        target:
23          - alpine
24          - debian-i386
25          - dfly30
26          - dfly48
27          - dfly58
28          - dfly60
29          - dfly62
30          - fbsd10
31          - fbsd12
32          - fbsd13
33          - minix3
34          - nbsd3
35          - nbsd4
36          - nbsd8
37          - nbsd9
38          - obsd51
39          - obsd67
40          - obsd69
41          - obsd70
42          - obsdsnap
43          - obsdsnap-i386
44          - openindiana
45          - sol10
46          - sol11
47        config:
48          - default
49        host:
50          - libvirt
51        include:
52          # Then we include extra libvirt test configs.
53          - { target: aix51, config: default, host: libvirt }
54          - { target: debian-i386, config: pam, host: libvirt }
55          - { target: dfly30, config: without-openssl, host: libvirt}
56          - { target: dfly48, config: pam ,host: libvirt }
57          - { target: dfly58, config: pam, host: libvirt }
58          - { target: dfly60, config: pam, host: libvirt }
59          - { target: dfly62, config: pam, host: libvirt }
60          - { target: fbsd10, config: pam, host: libvirt }
61          - { target: fbsd12, config: pam, host: libvirt }
62          - { target: fbsd13, config: pam, host: libvirt }
63          - { target: nbsd8,  config: pam, host: libvirt }
64          - { target: nbsd9,  config: pam, host: libvirt }
65          - { target: openindiana, config: pam, host: libvirt }
66          - { target: sol10,  config: pam, host: libvirt }
67          - { target: sol11,  config: pam-krb5, host: libvirt }
68          - { target: sol11,  config: sol64, host: libvirt }
69          # VMs with persistent disks that have their own runner.
70          - { target: win10, config: default, host: win10 }
71          - { target: win10, config: cygwin-release, host: win10 }
72          # Physical hosts, with either native runners or remote via ssh.
73          - { target: ARM, config: default, host: ARM }
74          - { target: ARM64, config: default, host: ARM64 }
75          - { target: ARM64, config: pam, host: ARM64 }
76          - { target: debian-riscv64, config: default, host: debian-riscv64 }
77          - { target: openwrt-mips, config: default, host: openwrt-mips }
78          - { target: openwrt-mipsel, config: default, host: openwrt-mipsel }
79    steps:
80    - name: shutdown VM if running
81      run: vmshutdown
82      working-directory: ${{ runner.temp }}
83    - uses: actions/checkout@main
84    - name: autoreconf
85      run: autoreconf
86    - name: startup VM
87      run: vmstartup
88      working-directory: ${{ runner.temp }}
89    - name: configure
90      run: vmrun ./.github/configure.sh ${{ matrix.config }}
91    - name: save config
92      uses: actions/upload-artifact@main
93      with:
94        name: ${{ matrix.target }}-${{ matrix.config }}-config
95        path: config.h
96    - name: make clean
97      run: vmrun make clean
98    - name: make
99      run: vmrun make
100    - name: make tests
101      run: vmrun ./.github/run_test.sh ${{ matrix.config }}
102      timeout-minutes: 600
103    - name: save logs
104      if: failure()
105      uses: actions/upload-artifact@main
106      with:
107        name: ${{ matrix.target }}-${{ matrix.config }}-logs
108        path: |
109          config.h
110          config.log
111          regress/*.log
112          regress/valgrind-out/
113    - name: shutdown VM
114      if: always()
115      run: vmshutdown
116      working-directory: ${{ runner.temp }}
117