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