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, bbone, fbsd12]
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: fbsd12, configs: pam }
28         - { vm: sol10,  configs: pam }
29         - { vm: sol11,  configs: pam }
30         - { vm: sol11,  configs: sol64 }
31         # - { vm: sol11,  configs: sol64-pam }
32    steps:
33    - uses: actions/checkout@v2
34    - name: autoreconf
35      run: autoreconf
36    - name: shutdown VM if running
37      run: vmshutdown
38    - name: startup VM
39      run: vmstartup
40    - name: configure
41      run: vmrun ./.github/configure.sh ${{ matrix.configs }}
42    - name: save config files
43      if: always()
44      uses: actions/upload-artifact@v2
45      with:
46        name: ${{ matrix.vm }}-${{ matrix.configs }}-config-files
47        path: |
48          config.h
49          config.log
50    - name: make
51      run: vmrun make
52    - name: install moduli
53      run: vmrun "sudo mkdir -p /usr/local/etc/; sudo cp moduli /usr/local/etc/"
54    - name: make tests
55      run: vmrun ./.github/run_test.sh ${{ matrix.configs }}
56    - name: save regress logs
57      if: failure()
58      uses: actions/upload-artifact@v2
59      with:
60        name: ${{ matrix.vm }}-${{ matrix.configs }}-regress-logs
61        path: regress/*.log
62    - name: shutdown VM
63      if: always()
64      run: vmshutdown
65