1name: C/C++ CI self-hosted
2
3on:
4  push:
5    branches: [ master, ci ]
6
7jobs:
8  selfhosted:
9    if: github.repository == 'openssh/openssh-portable-selfhosted'
10    runs-on: ${{ matrix.vm }}
11    env:
12      TARGET_HOST: ${{ matrix.vm }}
13      SUDO: sudo
14    strategy:
15      fail-fast: false
16      # We use a matrix in two parts: firstly all of the VMs are tested with the
17      # default config.  "vm" corresponds to a label associated with the worker.
18      matrix:
19        vm: [dfly30, dfly48, dfly58, sol10, sol11]
20        configs:
21          - default
22        # Then we include any extra configs we want to test for specific VMs.
23        include:
24         - { vm: dfly30, configs: without-openssl}
25         - { vm: dfly48, configs: pam }
26         - { vm: dfly58, configs: pam }
27         - { vm: sol10,  configs: pam }
28         - { vm: sol11,  configs: pam }
29         - { vm: sol11,  configs: sol64 }
30         - { vm: sol11,  configs: sol64-pam }
31    steps:
32    - uses: actions/checkout@v2
33    - name: autoreconf
34      run: autoreconf
35    - name: shutdown VM if running
36      run: vmshutdown
37    - name: startup VM
38      run: vmstartup
39    - name: configure
40      run: vmrun ./.github/configure.sh ${{ matrix.configs }}
41    - name: save config files
42      if: always()
43      uses: actions/upload-artifact@v2
44      with:
45        name: ${{ matrix.vm }}-${{ matrix.configs }}-config-files
46        path: |
47          config.h
48          config.log
49    - name: make
50      run: vmrun make
51    - name: install moduli
52      run: vmrun "sudo mkdir -p /usr/local/etc/; sudo cp moduli /usr/local/etc/"
53    - name: make tests
54      run: vmrun ./.github/run_test.sh ${{ matrix.configs }}
55    - name: save regress logs
56      if: failure()
57      uses: actions/upload-artifact@v2
58      with:
59        name: ${{ matrix.vm }}-${{ matrix.configs }}-regress-logs
60        path: regress/*.log
61    - name: shutdown VM
62      if: always()
63      run: vmshutdown
64