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