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: pam }
27          - { os: ubuntu-20.04, configs: kitchensink }
28          - { os: ubuntu-20.04, configs: hardenedmalloc }
29          - { os: ubuntu-20.04, configs: libressl-master }
30          - { os: ubuntu-20.04, configs: libressl-2.2.9 }
31          - { os: ubuntu-20.04, configs: libressl-2.8.3 }
32          - { os: ubuntu-20.04, configs: libressl-3.0.2 }
33          - { os: ubuntu-20.04, configs: libressl-3.2.5 }
34          - { os: ubuntu-20.04, configs: openssl-master }
35          - { os: ubuntu-20.04, configs: openssl-1.0.1 }
36          - { os: ubuntu-20.04, configs: openssl-1.0.1u }
37          - { os: ubuntu-20.04, configs: openssl-1.0.2u }
38          - { os: ubuntu-20.04, configs: openssl-1.1.0g }
39          - { os: ubuntu-20.04, configs: openssl-1.1.1 }
40          - { os: ubuntu-20.04, configs: openssl-1.1.1k }
41          - { os: ubuntu-18.04, configs: pam }
42          - { os: ubuntu-18.04, configs: kerberos5 }
43          - { os: ubuntu-18.04, configs: libedit }
44          - { os: ubuntu-18.04, configs: sk }
45          - { os: ubuntu-18.04, configs: selinux }
46          - { os: ubuntu-18.04, configs: kitchensink }
47          - { os: ubuntu-18.04, configs: without-openssl }
48          - { os: ubuntu-16.04, configs: pam }
49          - { os: ubuntu-16.04, configs: kitchensink }
50          - { os: macos-10.15,  configs: pam }
51          - { os: macos-11.0,   configs: pam }
52    runs-on: ${{ matrix.os }}
53    steps:
54    - uses: actions/checkout@v2
55    - name: setup CI system
56      run: ./.github/setup_ci.sh ${{ matrix.configs }}
57    - name: autoreconf
58      run: autoreconf
59    - name: configure
60      run: ./.github/configure.sh ${{ matrix.configs }}
61    - name: make
62      run: make -j2
63    - name: make tests
64      run: ./.github/run_test.sh ${{ matrix.configs }}
65      env:
66        TEST_SSH_UNSAFE_PERMISSIONS: 1
67    - name: save logs
68      if: failure()
69      uses: actions/upload-artifact@v2
70      with:
71        name: ${{ matrix.os }}-${{ matrix.configs }}-logs
72        path: |
73          config.h
74          config.log
75          regress/*.log
76          regress/valgrind-out/
77