1name: C/C++ CI
2
3on:
4  push:
5    branches: [ master, ci ]
6  pull_request:
7    branches: [ master ]
8
9jobs:
10  ci:
11    if: github.repository != 'openssh/openssh-portable-selfhosted'
12    strategy:
13      fail-fast: false
14      matrix:
15        # First we test all OSes in the default configuration.
16        os: [ubuntu-20.04, ubuntu-18.04, ubuntu-16.04, macos-10.15, macos-11.0]
17        configs: [default]
18        # Then we include any extra configs we want to test for specific VMs.
19        # Valgrind slows things down quite a bit, so start them first.
20        include:
21          - { os: ubuntu-20.04, configs: valgrind-1 }
22          - { os: ubuntu-20.04, configs: valgrind-2 }
23          - { os: ubuntu-20.04, configs: valgrind-3 }
24          - { os: ubuntu-20.04, configs: valgrind-4 }
25          - { os: ubuntu-20.04, configs: valgrind-unit }
26          - { os: ubuntu-20.04, configs: c89 }
27          - { os: ubuntu-20.04, configs: pam }
28          - { os: ubuntu-20.04, configs: kitchensink }
29          - { os: ubuntu-20.04, configs: hardenedmalloc }
30          - { os: ubuntu-20.04, configs: libressl-master }
31          - { os: ubuntu-20.04, configs: libressl-2.2.9 }
32          - { os: ubuntu-20.04, configs: libressl-2.8.3 }
33          - { os: ubuntu-20.04, configs: libressl-3.0.2 }
34          - { os: ubuntu-20.04, configs: libressl-3.2.5 }
35          - { os: ubuntu-20.04, configs: openssl-master }
36          - { os: ubuntu-20.04, configs: openssl-1.0.1 }
37          - { os: ubuntu-20.04, configs: openssl-1.0.1u }
38          - { os: ubuntu-20.04, configs: openssl-1.0.2u }
39          - { os: ubuntu-20.04, configs: openssl-1.1.0g }
40          - { os: ubuntu-20.04, configs: openssl-1.1.1 }
41          - { os: ubuntu-20.04, configs: openssl-1.1.1k }
42          - { os: ubuntu-18.04, configs: pam }
43          - { os: ubuntu-18.04, configs: kerberos5 }
44          - { os: ubuntu-18.04, configs: libedit }
45          - { os: ubuntu-18.04, configs: sk }
46          - { os: ubuntu-18.04, configs: selinux }
47          - { os: ubuntu-18.04, configs: kitchensink }
48          - { os: ubuntu-18.04, configs: without-openssl }
49          - { os: ubuntu-16.04, configs: pam }
50          - { os: ubuntu-16.04, configs: kitchensink }
51          - { os: macos-10.15,  configs: pam }
52          - { os: macos-11.0,   configs: pam }
53    runs-on: ${{ matrix.os }}
54    steps:
55    - uses: actions/checkout@v2
56    - name: setup CI system
57      run: ./.github/setup_ci.sh ${{ matrix.configs }}
58    - name: autoreconf
59      run: autoreconf
60    - name: configure
61      run: ./.github/configure.sh ${{ matrix.configs }}
62    - name: make
63      run: make -j2
64    - name: make tests
65      run: ./.github/run_test.sh ${{ matrix.configs }}
66      env:
67        TEST_SSH_UNSAFE_PERMISSIONS: 1
68    - name: save logs
69      if: failure()
70      uses: actions/upload-artifact@v2
71      with:
72        name: ${{ matrix.os }}-${{ matrix.configs }}-logs
73        path: |
74          config.h
75          config.log
76          regress/*.log
77          regress/valgrind-out/
78