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