Skip to content

Add nat20 integration test suite for linux examples #589

Add nat20 integration test suite for linux examples

Add nat20 integration test suite for linux examples #589

# Copyright 2024 Aurora Operations, Inc.
#
# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0
#
# This work is dual licensed.
# You may use it under Apache-2.0 or GPL-2.0 at your option.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# OR
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see
# <https://www.gnu.org/licenses/>.
name: cmake-build-and-test
on:
push:
branches:
- main
pull_request:
jobs:
cmake-build-and-test:
name: Build and test (${{ matrix.options.name }})
strategy:
matrix:
options: [
{ name: 'no-tests', extra_cmake_args: ' -DNAT20_WITH_TESTS=OFF -DNAT20_WITH_CRYPTO_BSSL=ON', extra_targets: '' },
{ name: 'both-encodings', extra_cmake_args: ' -DNAT20_WITH_TESTS=ON -DNAT20_WITH_CRYPTO_BSSL=ON', extra_targets: 'test' },
{ name: 'x509-only', extra_cmake_args: ' -DNAT20_WITH_TESTS=ON -DNAT20_WITH_CRYPTO_BSSL=ON -DNAT20_WITHOUT_X509=OFF -DNAT20_WITHOUT_COSE=ON', extra_targets: 'test' },
{ name: 'cose-only', extra_cmake_args: ' -DNAT20_WITH_TESTS=ON -DNAT20_WITH_CRYPTO_BSSL=ON -DNAT20_WITHOUT_X509=ON -DNAT20_WITHOUT_COSE=OFF', extra_targets: 'test' }
]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b #v4.1.5
- name: Setup CMake
uses: jwlawson/actions-setup-cmake@802fa1a2c4e212495c05bf94dba2704a92a472be #v2.0.2
with:
cmake-version: '3.22.x'
- name: Generate
run: cmake -S . -B cmake/build ${{ matrix.options.extra_cmake_args }}
- name: Build and test
run: cmake --build cmake/build -j $(( $(nproc) + 1 )) --target all ${{ matrix.options.extra_targets }}