xref: /freebsd/crypto/openssh/.github/workflows/c-cpp.yml (revision 3d9fd9fcb432750f3716b28f6ccb0104cd9d351a)
119261079SEd Mastename: C/C++ CI
219261079SEd Maste
319261079SEd Masteon:
419261079SEd Maste  push:
5*0fdf8faeSEd Maste    paths: [ '**.c', '**.h', '**.m4', '**.sh', '**/Makefile.in', 'configure.ac', '.github/configs', '.github/workflows/c-cpp.yaml' ]
619261079SEd Maste  pull_request:
7*0fdf8faeSEd Maste    paths: [ '**.c', '**.h', '**.m4', '**.sh', '**/Makefile.in', 'configure.ac', '.github/configs', '.github/workflows/c-cpp.yaml' ]
819261079SEd Maste
919261079SEd Mastejobs:
1019261079SEd Maste  ci:
11*0fdf8faeSEd Maste    name: "${{ matrix.target }} ${{ matrix.config }}"
1219261079SEd Maste    if: github.repository != 'openssh/openssh-portable-selfhosted'
1319261079SEd Maste    strategy:
1419261079SEd Maste      fail-fast: false
1519261079SEd Maste      matrix:
1619261079SEd Maste        # First we test all OSes in the default configuration.
17535af610SEd Maste        target:
18535af610SEd Maste          - ubuntu-20.04
19535af610SEd Maste          - ubuntu-22.04
20535af610SEd Maste          - macos-12
21535af610SEd Maste          - macos-13
22*0fdf8faeSEd Maste          - macos-14
23535af610SEd Maste          - windows-2019
24535af610SEd Maste          - windows-2022
25f374ba41SEd Maste        config: [default]
2619261079SEd Maste        # Then we include any extra configs we want to test for specific VMs.
2719261079SEd Maste        # Valgrind slows things down quite a bit, so start them first.
2819261079SEd Maste        include:
29f374ba41SEd Maste          - { target: windows-2019, config: cygwin-release }
30f374ba41SEd Maste          - { target: windows-2022, config: cygwin-release }
31f374ba41SEd Maste          - { target: ubuntu-20.04, config: valgrind-1 }
32f374ba41SEd Maste          - { target: ubuntu-20.04, config: valgrind-2 }
33f374ba41SEd Maste          - { target: ubuntu-20.04, config: valgrind-3 }
34f374ba41SEd Maste          - { target: ubuntu-20.04, config: valgrind-4 }
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*0fdf8faeSEd Maste          - { target: ubuntu-latest, config: libressl-3.8.4 }
66*0fdf8faeSEd Maste          - { target: ubuntu-latest, config: libressl-3.9.1 }
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 }
73a91a2465SEd Maste          - { target: ubuntu-latest, config: openssl-3.0.13 }
74535af610SEd Maste          - { target: ubuntu-latest, config: openssl-3.1.0 }
75a91a2465SEd Maste          - { target: ubuntu-latest, config: openssl-3.1.5 }
76a91a2465SEd Maste          - { target: ubuntu-latest, config: openssl-3.2.1 }
77*0fdf8faeSEd Maste          - { target: ubuntu-latest, config: openssl-3.3.0 }
78f374ba41SEd Maste          - { target: ubuntu-latest, config: openssl-1.1.1_stable }
79f374ba41SEd Maste          - { target: ubuntu-latest, config: openssl-3.0 }  # stable branch
80*0fdf8faeSEd Maste          - { target: ubuntu-latest, config: openssl-3.1 }  # stable branch
81069ac184SEd Maste          - { target: ubuntu-latest, config: openssl-3.2 }  # stable branch
82*0fdf8faeSEd Maste          - { target: ubuntu-latest, config: openssl-3.3 }  # stable branch
83a91a2465SEd Maste          - { target: ubuntu-latest, config: putty-0.71 }
84a91a2465SEd Maste          - { target: ubuntu-latest, config: putty-0.72 }
85a91a2465SEd Maste          - { target: ubuntu-latest, config: putty-0.73 }
86a91a2465SEd Maste          - { target: ubuntu-latest, config: putty-0.74 }
87a91a2465SEd Maste          - { target: ubuntu-latest, config: putty-0.75 }
88a91a2465SEd Maste          - { target: ubuntu-latest, config: putty-0.76 }
89a91a2465SEd Maste          - { target: ubuntu-latest, config: putty-0.77 }
90a91a2465SEd Maste          - { target: ubuntu-latest, config: putty-0.78 }
91a91a2465SEd Maste          - { target: ubuntu-latest, config: putty-0.79 }
92a91a2465SEd Maste          - { target: ubuntu-latest, config: putty-0.80 }
93a91a2465SEd Maste          - { target: ubuntu-latest, config: putty-snapshot }
94edf85781SEd Maste          - { target: ubuntu-latest, config: zlib-develop }
95f374ba41SEd Maste          - { target: ubuntu-22.04, config: pam }
96f374ba41SEd Maste          - { target: ubuntu-22.04, config: krb5 }
97f374ba41SEd Maste          - { target: ubuntu-22.04, config: heimdal }
98f374ba41SEd Maste          - { target: ubuntu-22.04, config: libedit }
99f374ba41SEd Maste          - { target: ubuntu-22.04, config: sk }
100f374ba41SEd Maste          - { target: ubuntu-22.04, config: selinux }
101f374ba41SEd Maste          - { target: ubuntu-22.04, config: kitchensink }
102f374ba41SEd Maste          - { target: ubuntu-22.04, config: without-openssl }
103f374ba41SEd Maste          - { target: macos-12, config: pam }
104535af610SEd Maste          - { target: macos-13, config: pam }
105*0fdf8faeSEd Maste          - { target: macos-14, config: pam }
106f374ba41SEd Maste    runs-on: ${{ matrix.target }}
10719261079SEd Maste    steps:
10838a52bd3SEd Maste    - name: set cygwin git params
109f374ba41SEd Maste      if: ${{ startsWith(matrix.target, 'windows') }}
11038a52bd3SEd Maste      run: git config --global core.autocrlf input
11138a52bd3SEd Maste    - name: install cygwin
112f374ba41SEd Maste      if: ${{ startsWith(matrix.target, 'windows') }}
11338a52bd3SEd Maste      uses: cygwin/cygwin-install-action@master
114f374ba41SEd Maste    - uses: actions/checkout@main
11519261079SEd Maste    - name: setup CI system
116f374ba41SEd Maste      run: sh ./.github/setup_ci.sh ${{ matrix.config }}
11719261079SEd Maste    - name: autoreconf
11838a52bd3SEd Maste      run: sh -c autoreconf
11919261079SEd Maste    - name: configure
120f374ba41SEd Maste      run: sh ./.github/configure.sh ${{ matrix.config }}
1211323ec57SEd Maste    - name: save config
122f374ba41SEd Maste      uses: actions/upload-artifact@main
1231323ec57SEd Maste      with:
124f374ba41SEd Maste        name: ${{ matrix.target }}-${{ matrix.config }}-config
1251323ec57SEd Maste        path: config.h
1261323ec57SEd Maste    - name: make clean
1271323ec57SEd Maste      run: make clean
12819261079SEd Maste    - name: make
129069ac184SEd Maste      run: make
13019261079SEd Maste    - name: make tests
131f374ba41SEd Maste      run: sh ./.github/run_test.sh ${{ matrix.config }}
13219261079SEd Maste      env:
13319261079SEd Maste        TEST_SSH_UNSAFE_PERMISSIONS: 1
13438a52bd3SEd Maste        TEST_SSH_HOSTBASED_AUTH: yes
13519261079SEd Maste    - name: save logs
13619261079SEd Maste      if: failure()
137f374ba41SEd Maste      uses: actions/upload-artifact@main
13819261079SEd Maste      with:
139f374ba41SEd Maste        name: ${{ matrix.target }}-${{ matrix.config }}-logs
14019261079SEd Maste        path: |
14119261079SEd Maste          config.h
14219261079SEd Maste          config.log
14319261079SEd Maste          regress/*.log
14419261079SEd Maste          regress/valgrind-out/
14538a52bd3SEd Maste          regress/asan.log.*
14638a52bd3SEd Maste          regress/msan.log.*
1474d3fc8b0SEd Maste          regress/log/*
148