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    runs-on: ${{ matrix.os }}
39    steps:
40    - uses: actions/checkout@v2
41    - name: setup CI system
42      run: ./.github/setup_ci.sh ${{ matrix.configs }}
43    - name: autoreconf
44      run: autoreconf
45    - name: configure
46      run: ./.github/configure.sh ${{ matrix.configs }}
47    - name: make
48      run: make -j2
49    - name: install moduli
50      run: sudo sh -c "mkdir -p /usr/local/etc/; cp moduli /usr/local/etc/"
51    - name: make tests
52      run: ./.github/run_test.sh ${{ matrix.configs }}
53      env:
54        SUDO: sudo
55        TEST_SSH_UNSAFE_PERMISSIONS: 1
56    - name: save regress logs
57      if: failure()
58      uses: actions/upload-artifact@v2
59      with:
60        name: ${{ matrix.os }}-${{ matrix.configs }}-regress-logs
61        path: |
62          regress/*.log
63          regress/valgrind-out/
64