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]
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    runs-on: ${{ matrix.os }}
42    steps:
43    - uses: actions/checkout@v2
44    - name: setup CI system
45      run: ./.github/setup_ci.sh ${{ matrix.configs }}
46    - name: autoreconf
47      run: autoreconf
48    - name: configure
49      run: ./.github/configure.sh ${{ matrix.configs }}
50    - name: make
51      run: make -j2
52    - name: make tests
53      run: ./.github/run_test.sh ${{ matrix.configs }}
54      env:
55        TEST_SSH_UNSAFE_PERMISSIONS: 1
56    - name: save logs
57      if: failure()
58      uses: actions/upload-artifact@v2
59      with:
60        name: ${{ matrix.os }}-${{ matrix.configs }}-logs
61        path: |
62          config.h
63          config.log
64          regress/*.log
65          regress/valgrind-out/
66