xref: /freebsd/crypto/openssh/.github/workflows/c-cpp.yml (revision a91a246563dffa876a52f53a98de4af9fa364c52)
119261079SEd Mastename: C/C++ CI
219261079SEd Maste
319261079SEd Masteon:
419261079SEd Maste  push:
5f374ba41SEd Maste    paths: [ '**.c', '**.h', '**.m4', '**.sh', '.github/**', '**/Makefile.in', 'configure.ac' ]
619261079SEd Maste  pull_request:
7f374ba41SEd Maste    paths: [ '**.c', '**.h', '**.m4', '**.sh', '.github/**', '**/Makefile.in', 'configure.ac' ]
819261079SEd Maste
919261079SEd Mastejobs:
1019261079SEd Maste  ci:
1119261079SEd Maste    if: github.repository != 'openssh/openssh-portable-selfhosted'
1219261079SEd Maste    strategy:
1319261079SEd Maste      fail-fast: false
1419261079SEd Maste      matrix:
1519261079SEd Maste        # First we test all OSes in the default configuration.
16535af610SEd Maste        target:
17535af610SEd Maste          - ubuntu-20.04
18535af610SEd Maste          - ubuntu-22.04
19535af610SEd Maste          - macos-11
20535af610SEd Maste          - macos-12
21535af610SEd Maste          - macos-13
22535af610SEd Maste          - windows-2019
23535af610SEd Maste          - windows-2022
24f374ba41SEd Maste        config: [default]
2519261079SEd Maste        # Then we include any extra configs we want to test for specific VMs.
2619261079SEd Maste        # Valgrind slows things down quite a bit, so start them first.
2719261079SEd Maste        include:
28f374ba41SEd Maste          - { target: windows-2019, config: cygwin-release }
29f374ba41SEd Maste          - { target: windows-2022, config: cygwin-release }
30f374ba41SEd Maste          - { target: ubuntu-20.04, config: valgrind-1 }
31f374ba41SEd Maste          - { target: ubuntu-20.04, config: valgrind-2 }
32f374ba41SEd Maste          - { target: ubuntu-20.04, config: valgrind-3 }
33f374ba41SEd Maste          - { target: ubuntu-20.04, config: valgrind-4 }
34f374ba41SEd Maste          - { target: ubuntu-20.04, config: valgrind-5 }
35f374ba41SEd Maste          - { target: ubuntu-20.04, config: valgrind-unit }
36f374ba41SEd Maste          - { target: ubuntu-20.04, config: c89 }
37f374ba41SEd Maste          - { target: ubuntu-20.04, config: clang-6.0 }
38f374ba41SEd Maste          - { target: ubuntu-20.04, config: clang-8 }
39f374ba41SEd Maste          - { target: ubuntu-20.04, config: clang-9 }
40f374ba41SEd Maste          - { target: ubuntu-20.04, config: clang-10 }
41f374ba41SEd Maste          - { target: ubuntu-20.04, config: clang-11 }
42f374ba41SEd Maste          - { target: ubuntu-20.04, config: clang-12-Werror }
43f374ba41SEd Maste          - { target: ubuntu-20.04, config: clang-sanitize-address }
44f374ba41SEd Maste          - { target: ubuntu-20.04, config: clang-sanitize-undefined }
45f374ba41SEd Maste          - { target: ubuntu-20.04, config: gcc-sanitize-address }
46f374ba41SEd Maste          - { target: ubuntu-20.04, config: gcc-sanitize-undefined }
47f374ba41SEd Maste          - { target: ubuntu-20.04, config: gcc-7 }
48f374ba41SEd Maste          - { target: ubuntu-20.04, config: gcc-8 }
49f374ba41SEd Maste          - { target: ubuntu-20.04, config: gcc-10 }
50069ac184SEd Maste          - { target: ubuntu-22.04, config: gcc-11-Werror }
51069ac184SEd Maste          - { target: ubuntu-22.04, config: gcc-12-Werror }
52f374ba41SEd Maste          - { target: ubuntu-20.04, config: pam }
53f374ba41SEd Maste          - { target: ubuntu-20.04, config: kitchensink }
54535af610SEd Maste          - { target: ubuntu-22.04, config: hardenedmalloc }
55f374ba41SEd Maste          - { target: ubuntu-20.04, config: tcmalloc }
56f374ba41SEd Maste          - { target: ubuntu-20.04, config: musl }
57535af610SEd Maste          - { target: ubuntu-latest, config: boringssl }
58f374ba41SEd Maste          - { target: ubuntu-latest, config: libressl-master }
59f374ba41SEd Maste          - { target: ubuntu-latest, config: libressl-3.2.6 }
60f374ba41SEd Maste          - { target: ubuntu-latest, config: libressl-3.3.6 }
61f374ba41SEd Maste          - { target: ubuntu-latest, config: libressl-3.4.3 }
62f374ba41SEd Maste          - { target: ubuntu-latest, config: libressl-3.5.3 }
63f374ba41SEd Maste          - { target: ubuntu-latest, config: libressl-3.6.1 }
64535af610SEd Maste          - { target: ubuntu-latest, config: libressl-3.7.2 }
65*a91a2465SEd Maste          - { target: ubuntu-latest, config: libressl-3.8.3 }
66*a91a2465SEd Maste          - { target: ubuntu-latest, config: libressl-3.9.0 }
67f374ba41SEd Maste          - { target: ubuntu-latest, config: openssl-master }
68f374ba41SEd Maste          - { target: ubuntu-latest, config: openssl-noec }
69f374ba41SEd Maste          - { target: ubuntu-latest, config: openssl-1.1.1 }
70535af610SEd Maste          - { target: ubuntu-latest, config: openssl-1.1.1t }
71069ac184SEd Maste          - { target: ubuntu-latest, config: openssl-1.1.1w }
72f374ba41SEd Maste          - { target: ubuntu-latest, config: openssl-3.0.0 }
73*a91a2465SEd Maste          - { target: ubuntu-latest, config: openssl-3.0.13 }
74535af610SEd Maste          - { target: ubuntu-latest, config: openssl-3.1.0 }
75*a91a2465SEd Maste          - { target: ubuntu-latest, config: openssl-3.1.5 }
76*a91a2465SEd Maste          - { target: ubuntu-latest, config: openssl-3.2.1 }
77f374ba41SEd Maste          - { target: ubuntu-latest, config: openssl-1.1.1_stable }
78f374ba41SEd Maste          - { target: ubuntu-latest, config: openssl-3.0 }  # stable branch
79069ac184SEd Maste          - { target: ubuntu-latest, config: openssl-3.2 }  # stable branch
80*a91a2465SEd Maste          - { target: ubuntu-latest, config: putty-0.71 }
81*a91a2465SEd Maste          - { target: ubuntu-latest, config: putty-0.72 }
82*a91a2465SEd Maste          - { target: ubuntu-latest, config: putty-0.73 }
83*a91a2465SEd Maste          - { target: ubuntu-latest, config: putty-0.74 }
84*a91a2465SEd Maste          - { target: ubuntu-latest, config: putty-0.75 }
85*a91a2465SEd Maste          - { target: ubuntu-latest, config: putty-0.76 }
86*a91a2465SEd Maste          - { target: ubuntu-latest, config: putty-0.77 }
87*a91a2465SEd Maste          - { target: ubuntu-latest, config: putty-0.78 }
88*a91a2465SEd Maste          - { target: ubuntu-latest, config: putty-0.79 }
89*a91a2465SEd Maste          - { target: ubuntu-latest, config: putty-0.80 }
90*a91a2465SEd Maste          - { target: ubuntu-latest, config: putty-snapshot }
91edf85781SEd Maste          - { target: ubuntu-latest, config: zlib-develop }
92f374ba41SEd Maste          - { target: ubuntu-22.04, config: pam }
93f374ba41SEd Maste          - { target: ubuntu-22.04, config: krb5 }
94f374ba41SEd Maste          - { target: ubuntu-22.04, config: heimdal }
95f374ba41SEd Maste          - { target: ubuntu-22.04, config: libedit }
96f374ba41SEd Maste          - { target: ubuntu-22.04, config: sk }
97f374ba41SEd Maste          - { target: ubuntu-22.04, config: selinux }
98f374ba41SEd Maste          - { target: ubuntu-22.04, config: kitchensink }
99f374ba41SEd Maste          - { target: ubuntu-22.04, config: without-openssl }
100f374ba41SEd Maste          - { target: macos-11, config: pam }
101f374ba41SEd Maste          - { target: macos-12, config: pam }
102535af610SEd Maste          - { target: macos-13, config: pam }
103f374ba41SEd Maste    runs-on: ${{ matrix.target }}
10419261079SEd Maste    steps:
10538a52bd3SEd Maste    - name: set cygwin git params
106f374ba41SEd Maste      if: ${{ startsWith(matrix.target, 'windows') }}
10738a52bd3SEd Maste      run: git config --global core.autocrlf input
10838a52bd3SEd Maste    - name: install cygwin
109f374ba41SEd Maste      if: ${{ startsWith(matrix.target, 'windows') }}
11038a52bd3SEd Maste      uses: cygwin/cygwin-install-action@master
111f374ba41SEd Maste    - uses: actions/checkout@main
11219261079SEd Maste    - name: setup CI system
113f374ba41SEd Maste      run: sh ./.github/setup_ci.sh ${{ matrix.config }}
11419261079SEd Maste    - name: autoreconf
11538a52bd3SEd Maste      run: sh -c autoreconf
11619261079SEd Maste    - name: configure
117f374ba41SEd Maste      run: sh ./.github/configure.sh ${{ matrix.config }}
1181323ec57SEd Maste    - name: save config
119f374ba41SEd Maste      uses: actions/upload-artifact@main
1201323ec57SEd Maste      with:
121f374ba41SEd Maste        name: ${{ matrix.target }}-${{ matrix.config }}-config
1221323ec57SEd Maste        path: config.h
1231323ec57SEd Maste    - name: make clean
1241323ec57SEd Maste      run: make clean
12519261079SEd Maste    - name: make
126069ac184SEd Maste      run: make
12719261079SEd Maste    - name: make tests
128f374ba41SEd Maste      run: sh ./.github/run_test.sh ${{ matrix.config }}
12919261079SEd Maste      env:
13019261079SEd Maste        TEST_SSH_UNSAFE_PERMISSIONS: 1
13138a52bd3SEd Maste        TEST_SSH_HOSTBASED_AUTH: yes
13219261079SEd Maste    - name: save logs
13319261079SEd Maste      if: failure()
134f374ba41SEd Maste      uses: actions/upload-artifact@main
13519261079SEd Maste      with:
136f374ba41SEd Maste        name: ${{ matrix.target }}-${{ matrix.config }}-logs
13719261079SEd Maste        path: |
13819261079SEd Maste          config.h
13919261079SEd Maste          config.log
14019261079SEd Maste          regress/*.log
14119261079SEd Maste          regress/valgrind-out/
14238a52bd3SEd Maste          regress/asan.log.*
14338a52bd3SEd Maste          regress/msan.log.*
1444d3fc8b0SEd Maste          regress/log/*
145