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          - centos7
25          - debian-i386
26          - dfly30
27          - dfly48
28          - dfly60
29          - dfly62
30          - dfly64
31          - fbsd10
32          - fbsd12
33          - fbsd13
34          - minix3
35          - nbsd3
36          - nbsd4
37          - nbsd8
38          - nbsd9
39          - obsd51
40          - obsd67
41          - obsd69
42          - obsd70
43          - obsd72
44          - obsd73
45          - obsdsnap
46          - obsdsnap-i386
47          - openindiana
48          - sol10
49          - sol11
50        config:
51          - default
52        host:
53          - libvirt
54        include:
55          # Then we include extra libvirt test configs.
56          - { target: aix51, config: default, host: libvirt }
57          - { target: centos7, config: pam, host: libvirt }
58          - { target: debian-i386, config: pam, host: libvirt }
59          - { target: dfly30, config: without-openssl, host: libvirt}
60          - { target: dfly48, config: pam ,host: libvirt }
61          - { target: dfly58, config: pam, host: libvirt }
62          - { target: dfly60, config: pam, host: libvirt }
63          - { target: dfly62, config: pam, host: libvirt }
64          - { target: fbsd10, config: pam, host: libvirt }
65          - { target: fbsd12, config: pam, host: libvirt }
66          - { target: fbsd13, config: pam, host: libvirt }
67          - { target: nbsd8,  config: pam, host: libvirt }
68          - { target: nbsd9,  config: pam, host: libvirt }
69          - { target: openindiana, config: pam, host: libvirt }
70          - { target: sol10,  config: pam, host: libvirt }
71          - { target: sol11,  config: pam-krb5, host: libvirt }
72          - { target: sol11,  config: sol64, host: libvirt }
73          # VMs with persistent disks that have their own runner.
74          - { target: win10, config: default, host: win10 }
75          - { target: win10, config: cygwin-release, host: win10 }
76          # Physical hosts, with either native runners or remote via ssh.
77          - { target: ARM, config: default, host: ARM }
78          - { target: ARM64, config: default, host: ARM64 }
79          - { target: ARM64, config: pam, host: ARM64 }
80          - { target: debian-riscv64, config: default, host: debian-riscv64 }
81          - { target: obsd-arm64, config: default, host: obsd-arm64 }
82          - { target: openwrt-mips, config: default, host: openwrt-mips }
83          - { target: openwrt-mipsel, config: default, host: openwrt-mipsel }
84    steps:
85    - name: shutdown VM if running
86      run: vmshutdown
87      working-directory: ${{ runner.temp }}
88    - uses: actions/checkout@main
89    - name: autoreconf
90      run: autoreconf
91    - name: startup VM
92      run: vmstartup
93      working-directory: ${{ runner.temp }}
94    - name: configure
95      run: vmrun ./.github/configure.sh ${{ matrix.config }}
96    - name: save config
97      uses: actions/upload-artifact@main
98      with:
99        name: ${{ matrix.target }}-${{ matrix.config }}-config
100        path: config.h
101    - name: make clean
102      run: vmrun make clean
103    - name: make
104      run: vmrun make
105    - name: make tests
106      run: vmrun ./.github/run_test.sh ${{ matrix.config }}
107      timeout-minutes: 600
108    - name: save logs
109      if: failure()
110      uses: actions/upload-artifact@main
111      with:
112        name: ${{ matrix.target }}-${{ matrix.config }}-logs
113        path: |
114          config.h
115          config.log
116          regress/*.log
117          regress/log/*
118          regress/valgrind-out/
119    - name: shutdown VM
120      if: always()
121      run: vmshutdown
122      working-directory: ${{ runner.temp }}
123