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, 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: c89 }
27          - { os: ubuntu-20.04, configs: clang-6.0 }
28          - { os: ubuntu-20.04, configs: clang-8 }
29          - { os: ubuntu-20.04, configs: clang-9 }
30          - { os: ubuntu-20.04, configs: clang-10 }
31          - { os: ubuntu-20.04, configs: clang-11 }
32          - { os: ubuntu-20.04, configs: clang-12-Werror }
33          - { os: ubuntu-20.04, configs: gcc-7 }
34          - { os: ubuntu-20.04, configs: gcc-8 }
35          - { os: ubuntu-20.04, configs: gcc-10 }
36          - { os: ubuntu-20.04, configs: gcc-11-Werror }
37          - { os: ubuntu-20.04, configs: pam }
38          - { os: ubuntu-20.04, configs: kitchensink }
39          - { os: ubuntu-20.04, configs: hardenedmalloc }
40          - { os: ubuntu-20.04, configs: tcmalloc }
41          - { os: ubuntu-20.04, configs: musl }
42          - { os: ubuntu-latest, configs: libressl-master }
43          - { os: ubuntu-latest, configs: libressl-2.2.9 }
44          - { os: ubuntu-latest, configs: libressl-2.8.3 }
45          - { os: ubuntu-latest, configs: libressl-3.0.2 }
46          - { os: ubuntu-latest, configs: libressl-3.2.6 }
47          - { os: ubuntu-latest, configs: libressl-3.3.4 }
48          - { os: ubuntu-latest, configs: libressl-3.4.1 }
49          - { os: ubuntu-latest, configs: libressl-3.5.0 }
50          - { os: ubuntu-latest, configs: openssl-master }
51          - { os: ubuntu-latest, configs: openssl-noec }
52          - { os: ubuntu-latest, configs: openssl-1.0.1 }
53          - { os: ubuntu-latest, configs: openssl-1.0.1u }
54          - { os: ubuntu-latest, configs: openssl-1.0.2u }
55          - { os: ubuntu-latest, configs: openssl-1.1.0h }
56          - { os: ubuntu-latest, configs: openssl-1.1.1 }
57          - { os: ubuntu-latest, configs: openssl-1.1.1k }
58          - { os: ubuntu-latest, configs: openssl-1.1.1m }
59          - { os: ubuntu-latest, configs: openssl-3.0.0 }
60          - { os: ubuntu-latest, configs: openssl-3.0.1 }
61          - { os: ubuntu-latest, configs: openssl-1.1.1_stable } # stable branch
62          - { os: ubuntu-latest, configs: openssl-3.0 }          # stable branch
63          - { os: ubuntu-18.04, configs: pam }
64          - { os: ubuntu-18.04, configs: krb5 }
65          - { os: ubuntu-18.04, configs: heimdal }
66          - { os: ubuntu-18.04, configs: libedit }
67          - { os: ubuntu-18.04, configs: sk }
68          - { os: ubuntu-18.04, configs: selinux }
69          - { os: ubuntu-18.04, configs: kitchensink }
70          - { os: ubuntu-18.04, configs: without-openssl }
71          - { os: macos-10.15,  configs: pam }
72          - { os: macos-11.0,   configs: pam }
73    runs-on: ${{ matrix.os }}
74    steps:
75    - uses: actions/checkout@v2
76    - name: setup CI system
77      run: ./.github/setup_ci.sh ${{ matrix.configs }}
78    - name: autoreconf
79      run: autoreconf
80    - name: configure
81      run: ./.github/configure.sh ${{ matrix.configs }}
82    - name: save config
83      uses: actions/upload-artifact@v2
84      with:
85        name: ${{ matrix.os }}-${{ matrix.configs }}-config
86        path: config.h
87    - name: make clean
88      run: make clean
89    - name: make
90      run: make -j2
91    - name: make tests
92      run: ./.github/run_test.sh ${{ matrix.configs }}
93      env:
94        TEST_SSH_UNSAFE_PERMISSIONS: 1
95    - name: save logs
96      if: failure()
97      uses: actions/upload-artifact@v2
98      with:
99        name: ${{ matrix.os }}-${{ matrix.configs }}-logs
100        path: |
101          config.h
102          config.log
103          regress/*.log
104          regress/valgrind-out/
105