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