xref: /freebsd/crypto/openssh/.github/workflows/c-cpp.yml (revision d8096b2df282d7a50e56eddba523bcdda1676106)
1name: C/C++ CI
2
3on:
4  push:
5    branches: [ master, ci, V_9_0 ]
6    paths: [ '**.c', '**.h', '**.m4', '**.sh', '.github/**', 'Makefile.in', 'configure.ac' ]
7  pull_request:
8    branches: [ master ]
9    paths: [ '**.c', '**.h', '**.m4', '**.sh', '.github/**', 'Makefile.in', 'configure.ac' ]
10
11jobs:
12  ci:
13    if: github.repository != 'openssh/openssh-portable-selfhosted'
14    strategy:
15      fail-fast: false
16      matrix:
17        # First we test all OSes in the default configuration.
18        os: [ubuntu-20.04, ubuntu-22.04, macos-11, macos-12, windows-2019, windows-2022]
19        configs: [default]
20        # Then we include any extra configs we want to test for specific VMs.
21        # Valgrind slows things down quite a bit, so start them first.
22        include:
23          - { os: windows-2019, configs: cygwin-release }
24          - { os: windows-2022, configs: cygwin-release }
25          - { os: ubuntu-20.04, configs: valgrind-1 }
26          - { os: ubuntu-20.04, configs: valgrind-2 }
27          - { os: ubuntu-20.04, configs: valgrind-3 }
28          - { os: ubuntu-20.04, configs: valgrind-4 }
29          - { os: ubuntu-20.04, configs: valgrind-unit }
30          - { os: ubuntu-20.04, configs: c89 }
31          - { os: ubuntu-20.04, configs: clang-6.0 }
32          - { os: ubuntu-20.04, configs: clang-8 }
33          - { os: ubuntu-20.04, configs: clang-9 }
34          - { os: ubuntu-20.04, configs: clang-10 }
35          - { os: ubuntu-20.04, configs: clang-11 }
36          - { os: ubuntu-20.04, configs: clang-12-Werror }
37          - { os: ubuntu-20.04, configs: clang-sanitize-address }
38          - { os: ubuntu-20.04, configs: clang-sanitize-undefined }
39          - { os: ubuntu-20.04, configs: gcc-sanitize-address }
40          - { os: ubuntu-20.04, configs: gcc-sanitize-undefined }
41          - { os: ubuntu-20.04, configs: gcc-7 }
42          - { os: ubuntu-20.04, configs: gcc-8 }
43          - { os: ubuntu-20.04, configs: gcc-10 }
44          - { os: ubuntu-20.04, configs: gcc-11-Werror }
45          - { os: ubuntu-20.04, configs: pam }
46          - { os: ubuntu-20.04, configs: kitchensink }
47          - { os: ubuntu-20.04, configs: hardenedmalloc }
48          - { os: ubuntu-20.04, configs: tcmalloc }
49          - { os: ubuntu-20.04, configs: musl }
50          - { os: ubuntu-latest, configs: libressl-master }
51          - { os: ubuntu-latest, configs: libressl-2.2.9 }
52          - { os: ubuntu-latest, configs: libressl-2.8.3 }
53          - { os: ubuntu-latest, configs: libressl-3.0.2 }
54          - { os: ubuntu-latest, configs: libressl-3.2.6 }
55          - { os: ubuntu-latest, configs: libressl-3.3.6 }
56          - { os: ubuntu-latest, configs: libressl-3.4.3 }
57          - { os: ubuntu-latest, configs: libressl-3.5.3 }
58          - { os: ubuntu-latest, configs: openssl-master }
59          - { os: ubuntu-latest, configs: openssl-noec }
60          - { os: ubuntu-latest, configs: openssl-1.0.1 }
61          - { os: ubuntu-latest, configs: openssl-1.0.1u }
62          - { os: ubuntu-latest, configs: openssl-1.0.2u }
63          - { os: ubuntu-latest, configs: openssl-1.1.0h }
64          - { os: ubuntu-latest, configs: openssl-1.1.1 }
65          - { os: ubuntu-latest, configs: openssl-1.1.1k }
66          - { os: ubuntu-latest, configs: openssl-1.1.1n }
67          - { os: ubuntu-latest, configs: openssl-1.1.1p }
68          - { os: ubuntu-latest, configs: openssl-3.0.0 }
69          - { os: ubuntu-latest, configs: openssl-3.0.5 }
70          - { os: ubuntu-latest, configs: openssl-1.1.1_stable } # stable branch
71          - { os: ubuntu-latest, configs: openssl-3.0 }          # stable branch
72          - { os: ubuntu-22.04, configs: pam }
73          - { os: ubuntu-22.04, configs: krb5 }
74          - { os: ubuntu-22.04, configs: heimdal }
75          - { os: ubuntu-22.04, configs: libedit }
76          - { os: ubuntu-22.04, configs: sk }
77          - { os: ubuntu-22.04, configs: selinux }
78          - { os: ubuntu-22.04, configs: kitchensink }
79          - { os: ubuntu-22.04, configs: without-openssl }
80          - { os: macos-11, configs: pam }
81          - { os: macos-12, configs: pam }
82    runs-on: ${{ matrix.os }}
83    steps:
84    - name: set cygwin git params
85      if: ${{ startsWith(matrix.os, 'windows') }}
86      run: git config --global core.autocrlf input
87    - name: install cygwin
88      if: ${{ startsWith(matrix.os, 'windows') }}
89      uses: cygwin/cygwin-install-action@master
90    - uses: actions/checkout@v2
91    - name: setup CI system
92      run: sh ./.github/setup_ci.sh ${{ matrix.configs }}
93    - name: autoreconf
94      run: sh -c autoreconf
95    - name: configure
96      run: sh ./.github/configure.sh ${{ matrix.configs }}
97    - name: save config
98      uses: actions/upload-artifact@v2
99      with:
100        name: ${{ matrix.os }}-${{ matrix.configs }}-config
101        path: config.h
102    - name: make clean
103      run: make clean
104    - name: make
105      run: make -j2
106    - name: make tests
107      run: sh ./.github/run_test.sh ${{ matrix.configs }}
108      env:
109        TEST_SSH_UNSAFE_PERMISSIONS: 1
110        TEST_SSH_HOSTBASED_AUTH: yes
111    - name: save logs
112      if: failure()
113      uses: actions/upload-artifact@v2
114      with:
115        name: ${{ matrix.os }}-${{ matrix.configs }}-logs
116        path: |
117          config.h
118          config.log
119          regress/*.log
120          regress/valgrind-out/
121          regress/asan.log.*
122          regress/msan.log.*
123