xref: /freebsd/crypto/openssh/.github/workflows/selfhosted.yml (revision 3d9fd9fcb432750f3716b28f6ccb0104cd9d351a)
1name: C/C++ CI self-hosted
2
3on:
4  push:
5    paths: [ '**.c', '**.h', '**.m4', '**.sh', '**/Makefile.in', 'configure.ac', '.github/configs', '.github/workflows/selfhosted.yml' ]
6
7jobs:
8  selfhosted:
9    name: "${{ matrix.target }} ${{ matrix.config }}"
10    if: github.repository == 'openssh/openssh-portable-selfhosted'
11    runs-on: ${{ matrix.host }}
12    timeout-minutes: 600
13    env:
14      DEBUG_ACTIONS: false
15      HOST: ${{ matrix.host }}
16      TARGET_HOST: ${{ matrix.target }}
17      TARGET_CONFIG: ${{ matrix.config }}
18      TARGET_DOMAIN: ${{ startsWith(matrix.host, 'libvirt') && format('{0}-{1}-{2}', matrix.target, matrix.config, github.run_id) || matrix.target }}
19      EPHEMERAL: ${{ startsWith(matrix.host, 'libvirt') }}
20      PERSISTENT: ${{ startsWith(matrix.host, 'persist') }}
21      REMOTE: ${{ startsWith(matrix.host, 'remote') }}
22      VM: ${{ startsWith(matrix.host, 'libvirt') || startsWith(matrix.host, 'persist') }}
23      SSHFS: ${{ startsWith(matrix.host, 'libvirt') || startsWith(matrix.host, 'persist') || startsWith(matrix.host, 'remote') }}
24    strategy:
25      fail-fast: false
26      # We use a matrix in two parts: firstly all of the VMs are tested with the
27      # default config.  "target" corresponds to a label associated with the
28      # worker.  The default is an ephemeral VM running under libvirt.
29      matrix:
30        target:
31          - alpine
32          - centos7
33          - debian-i386
34          - dfly30
35          - dfly48
36          - dfly60
37          - dfly62
38          - dfly64
39          - fbsd10
40          - fbsd12
41          - fbsd13
42          - fbsd14
43          - minix3
44          - nbsd3
45          - nbsd4
46          - nbsd8
47          - nbsd9
48          - obsd51
49          - obsd67
50          - obsd72
51          - obsd73
52          - obsd74
53          - obsdsnap
54          - obsdsnap-i386
55          - omnios
56          - openindiana
57          - ubuntu-2204
58        config:
59          - default
60        host:
61          - libvirt
62        include:
63          # Long-running/slow tests have access to high priority runners.
64          - { target: aix51, config: default, host: libvirt-hipri }
65          - { target: openindiana, config: pam, host: libvirt-hipri }
66          - { target: sol10,  config: default, host: libvirt-hipri }
67          - { target: sol10,  config: pam, host: libvirt-hipri }
68          - { target: sol11,  config: default, host: libvirt-hipri }
69          - { target: sol11,  config: pam-krb5, host: libvirt-hipri }
70          - { target: sol11,  config: sol64, host: libvirt-hipri }
71          # Then we include extra libvirt test configs.
72          - { target: centos7, config: pam, host: libvirt }
73          - { target: debian-i386, config: pam, host: libvirt }
74          - { target: dfly30, config: without-openssl, host: libvirt}
75          - { target: dfly48, config: pam ,host: libvirt }
76          - { target: dfly58, config: pam, host: libvirt }
77          - { target: dfly60, config: pam, host: libvirt }
78          - { target: dfly62, config: pam, host: libvirt }
79          - { target: dfly64, config: pam, host: libvirt }
80          - { target: fbsd10, config: pam, host: libvirt }
81          - { target: fbsd12, config: pam, host: libvirt }
82          - { target: fbsd13, config: pam, host: libvirt }
83          - { target: fbsd14, config: pam, host: libvirt }
84          - { target: nbsd8,  config: pam, host: libvirt }
85          - { target: nbsd9,  config: pam, host: libvirt }
86          - { target: nbsd10, config: pam, host: libvirt }
87          - { target: omnios, config: pam, host: libvirt }
88          # ARM64 VMs
89          - { target: obsd-arm64, config: default, host: libvirt-arm64 }
90          # VMs with persistent disks that have their own runner.
91          - { target: win10, config: default,        host: persist-win10 }
92          - { target: win10, config: cygwin-release, host: persist-win10 }
93          # Physical hosts with native runners.
94          - { target: ARM, config: default, host: ARM }
95          - { target: ARM64, config: default, host: ARM64 }
96          - { target: ARM64, config: pam, host: ARM64 }
97          # Physical hosts with remote runners.
98          - { target: debian-riscv64, config: default, host: remote-debian-riscv64 }
99
100          - { target: openwrt-mips, config: default, host: remote-openwrt-mips }
101          - { target: openwrt-mipsel, config: default, host: remote-openwrt-mipsel }
102    steps:
103    - name: unmount stale workspace
104      if: env.SSHFS == 'true'
105      run: fusermount -u ${GITHUB_WORKSPACE} || true
106      working-directory: ${{ runner.temp }}
107    - name: shutdown VM if running
108      if: env.VM == 'true'
109      run: vmshutdown
110    - uses: actions/checkout@main
111    - name: autoreconf
112      run: autoreconf
113    - name: startup VM
114      if: env.VM == 'true'
115      run: vmstartup
116      working-directory: ${{ runner.temp }}
117    - name: copy and mount workspace
118      if: env.SSHFS == 'true'
119      run: sshfs_mount
120      working-directory: ${{ runner.temp }}
121    - name: configure
122      run: vmrun ./.github/configure.sh ${{ matrix.config }}
123#    - name: save config
124#      uses: actions/upload-artifact@main
125#      with:
126#        name: ${{ matrix.target }}-${{ matrix.config }}-config
127#        path: config.h
128    - name: make clean
129      run: vmrun make clean
130    - name: make
131      run: vmrun make
132    - name: make tests
133      run: vmrun ./.github/run_test.sh ${{ matrix.config }}
134      timeout-minutes: 600
135    - name: save logs
136      if: failure()
137      uses: actions/upload-artifact@main
138      with:
139        name: ${{ matrix.target }}-${{ matrix.config }}-logs
140        path: |
141          config.h
142          config.log
143          regress/*.log
144          regress/log/*
145          regress/valgrind-out/
146    - name: unmount workspace
147      if: always() && env.SSHFS == 'true'
148      run: fusermount -u ${GITHUB_WORKSPACE} || true
149      working-directory: ${{ runner.temp }}
150    - name: shutdown VM
151      if: always() && env.VM == 'true'
152      run: vmshutdown
153