xref: /freebsd/crypto/openssh/.github/workflows/c-cpp.yml (revision 8e28d84935f2f0ee081d44f9803f3052b960e50b)
1name: C/C++ CI
2
3on:
4  push:
5    paths: [ '**.c', '**.h', '**.m4', '**.sh', '**/Makefile.in', 'configure.ac', '.github/configs', '.github/workflows/c-cpp.yml' ]
6  pull_request:
7    paths: [ '**.c', '**.h', '**.m4', '**.sh', '**/Makefile.in', 'configure.ac', '.github/configs', '.github/workflows/c-cpp.yml' ]
8
9jobs:
10  ci:
11    name: "${{ matrix.target }} ${{ matrix.config }}"
12    if: github.repository != 'openssh/openssh-portable-selfhosted'
13    strategy:
14      fail-fast: false
15      matrix:
16        # First we test all OSes in the default configuration.
17        target:
18          - ubuntu-22.04
19          - ubuntu-latest
20          - ubuntu-22.04-arm
21          - ubuntu-24.04-arm
22          - macos-13
23          - macos-14
24          - macos-15
25          - windows-2019
26          - windows-2022
27        config: [default]
28        # Then we include any extra configs we want to test for specific VMs.
29        # Valgrind slows things down quite a bit, so start them first.
30        include:
31          - { target: windows-2019, config: cygwin-release }
32          - { target: windows-2022, config: cygwin-release }
33          - { target: ubuntu-22.04, config: c89 }
34          - { target: ubuntu-22.04, config: clang-11 }
35          - { target: ubuntu-22.04, config: clang-12-Werror }
36          - { target: ubuntu-22.04, config: clang-14 }
37          - { target: ubuntu-22.04, config: clang-sanitize-address }
38          - { target: ubuntu-22.04, config: clang-sanitize-undefined }
39          - { target: ubuntu-22.04, config: gcc-9 }
40          - { target: ubuntu-22.04, config: gcc-11-Werror }
41          - { target: ubuntu-22.04, config: gcc-12-Werror }
42          - { target: ubuntu-22.04, config: gcc-sanitize-address }
43          - { target: ubuntu-22.04, config: gcc-sanitize-undefined }
44          - { target: ubuntu-22.04, config: hardenedmalloc }
45          - { target: ubuntu-22.04, config: heimdal }
46          - { target: ubuntu-22.04, config: kitchensink }
47          - { target: ubuntu-22.04, config: krb5 }
48          - { target: ubuntu-22.04, config: libedit }
49          - { target: ubuntu-22.04, config: pam }
50          - { target: ubuntu-22.04, config: selinux }
51          - { target: ubuntu-22.04, config: sk }
52          - { target: ubuntu-22.04, config: valgrind-1 }
53          - { target: ubuntu-22.04, config: valgrind-2 }
54          - { target: ubuntu-22.04, config: valgrind-3 }
55          - { target: ubuntu-22.04, config: valgrind-4 }
56          - { target: ubuntu-22.04, config: valgrind-unit }
57          - { target: ubuntu-22.04, config: without-openssl }
58          - { target: ubuntu-latest, config: gcc-14 }
59          - { target: ubuntu-latest, config: clang-15 }
60          - { target: ubuntu-latest, config: clang-19 }
61          - { target: ubuntu-latest, config: boringssl }
62          - { target: ubuntu-latest, config: aws-lc }
63          - { target: ubuntu-latest, config: libressl-master }
64          - { target: ubuntu-latest, config: libressl-3.2.6 }
65          - { target: ubuntu-latest, config: libressl-3.3.6 }
66          - { target: ubuntu-latest, config: libressl-3.4.3 }
67          - { target: ubuntu-latest, config: libressl-3.5.3 }
68          - { target: ubuntu-latest, config: libressl-3.6.1 }
69          - { target: ubuntu-latest, config: libressl-3.7.2 }
70          - { target: ubuntu-latest, config: libressl-3.8.4 }
71          - { target: ubuntu-latest, config: libressl-3.9.2 }
72          - { target: ubuntu-latest, config: libressl-4.0.0 }
73          - { target: ubuntu-latest, config: openssl-master }
74          - { target: ubuntu-latest, config: openssl-noec }
75          - { target: ubuntu-latest, config: openssl-1.1.1 }
76          - { target: ubuntu-latest, config: openssl-1.1.1t }
77          - { target: ubuntu-latest, config: openssl-1.1.1w }
78          - { target: ubuntu-latest, config: openssl-3.0.0 }
79          - { target: ubuntu-latest, config: openssl-3.0.15 }
80          - { target: ubuntu-latest, config: openssl-3.1.0 }
81          - { target: ubuntu-latest, config: openssl-3.1.7 }
82          - { target: ubuntu-latest, config: openssl-3.2.3 }
83          - { target: ubuntu-latest, config: openssl-3.3.2 }
84          - { target: ubuntu-latest, config: openssl-3.4.0 }
85          - { target: ubuntu-latest, config: openssl-1.1.1_stable }
86          - { target: ubuntu-latest, config: openssl-3.0 }  # stable branch
87          - { target: ubuntu-latest, config: openssl-3.1 }  # stable branch
88          - { target: ubuntu-latest, config: openssl-3.2 }  # stable branch
89          - { target: ubuntu-latest, config: openssl-3.3 }  # stable branch
90          - { target: ubuntu-latest, config: putty-0.71 }
91          - { target: ubuntu-latest, config: putty-0.72 }
92          - { target: ubuntu-latest, config: putty-0.73 }
93          - { target: ubuntu-latest, config: putty-0.74 }
94          - { target: ubuntu-latest, config: putty-0.75 }
95          - { target: ubuntu-latest, config: putty-0.76 }
96          - { target: ubuntu-latest, config: putty-0.77 }
97          - { target: ubuntu-latest, config: putty-0.78 }
98          - { target: ubuntu-latest, config: putty-0.79 }
99          - { target: ubuntu-latest, config: putty-0.80 }
100          - { target: ubuntu-latest, config: putty-0.81 }
101          - { target: ubuntu-latest, config: putty-0.82 }
102          - { target: ubuntu-latest, config: putty-0.83 }
103          - { target: ubuntu-latest, config: putty-snapshot }
104          - { target: ubuntu-latest, config: zlib-develop }
105          - { target: ubuntu-latest, config: tcmalloc }
106          - { target: ubuntu-latest, config: musl }
107          - { target: ubuntu-22.04-arm, config: kitchensink }
108          - { target: ubuntu-24.04-arm, config: kitchensink }
109          - { target: macos-13, config: pam }
110          - { target: macos-14, config: pam }
111          - { target: macos-15, config: pam }
112    runs-on: ${{ matrix.target }}
113    steps:
114    - name: set cygwin git params
115      if: ${{ startsWith(matrix.target, 'windows') }}
116      run: git config --global core.autocrlf input
117    - name: install cygwin
118      if: ${{ startsWith(matrix.target, 'windows') }}
119      uses: cygwin/cygwin-install-action@master
120    - uses: actions/checkout@main
121    - name: setup CI system
122      run: sh ./.github/setup_ci.sh ${{ matrix.config }}
123    - name: autoreconf
124      run: sh -c autoreconf
125    - name: configure
126      run: sh ./.github/configure.sh ${{ matrix.config }}
127    - name: save config
128      uses: actions/upload-artifact@main
129      with:
130        name: ${{ matrix.target }}-${{ matrix.config }}-config
131        path: config.h
132    - name: make clean
133      run: make clean
134    - name: make
135      run: make
136    - name: make tests
137      run: sh ./.github/run_test.sh ${{ matrix.config }}
138      env:
139        TEST_SSH_UNSAFE_PERMISSIONS: 1
140        TEST_SSH_HOSTBASED_AUTH: yes
141    - name: save logs
142      if: failure()
143      uses: actions/upload-artifact@main
144      with:
145        name: ${{ matrix.target }}-${{ matrix.config }}-logs
146        path: |
147          config.h
148          config.log
149          regress/*.log
150          regress/valgrind-out/
151          regress/asan.log.*
152          regress/msan.log.*
153          regress/log/*
154