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.os }}
11    env:
12      TARGET_HOST: ${{ matrix.os }}
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        os:
20          - bbone
21          - dfly30
22          - dfly48
23          - dfly58
24          - fbsd6
25          - fbsd7
26          - fbsd12
27          - fbsd13
28          - obsd51
29          - sol10
30          - sol11
31        configs:
32          - default
33        # Then we include any extra configs we want to test for specific VMs.
34        include:
35         - { os: dfly30, configs: without-openssl}
36         - { os: dfly48, configs: pam }
37         - { os: dfly58, configs: pam }
38         - { os: fbsd6,  configs: pam }
39         - { os: fbsd7,  configs: pam }
40         - { os: fbsd12, configs: pam }
41         - { os: fbsd13, configs: pam }
42         - { os: sol10,  configs: pam }
43         - { os: sol11,  configs: pam }
44         - { os: sol11,  configs: sol64 }
45         # - { os: sol11,  configs: sol64-pam }
46    steps:
47    - uses: actions/checkout@v2
48    - name: autoreconf
49      run: autoreconf
50    - name: shutdown VM if running
51      run: vmshutdown
52    - name: startup VM
53      run: vmstartup
54    - name: configure
55      run: vmrun ./.github/configure.sh ${{ matrix.configs }}
56    - name: make
57      run: vmrun make
58    - name: make tests
59      run: vmrun ./.github/run_test.sh ${{ matrix.configs }}
60    - name: save logs
61      if: failure()
62      uses: actions/upload-artifact@v2
63      with:
64        name: ${{ matrix.os }}-${{ matrix.configs }}-logs
65        path: |
66          config.h
67          config.log
68          regress/*.log
69          regress/valgrind-out/
70    - name: shutdown VM
71      if: always()
72      run: vmshutdown
73