-set hot_teacup version to v3.1.0 #100
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build & test (clang, gcc) | |
on: | |
push: | |
branches: [ "master", "dev" ] | |
paths-ignore: | |
- '**.md' | |
pull_request: | |
branches: [ "master", "dev" ] | |
paths-ignore: | |
- '**.md' | |
jobs: | |
build: | |
name: ${{ matrix.config.name }} | |
runs-on: ${{ matrix.config.os }} | |
env: | |
CC: ${{ matrix.config.cc }} | |
CXX: ${{ matrix.config.cxx }} | |
strategy: | |
fail-fast: false | |
matrix: | |
config: | |
- { | |
name: "Ubuntu Latest gcc", | |
os: ubuntu-latest, | |
cc: "gcc", | |
cxx: "g++", | |
cmake_vars: "", | |
asio_type: "standalone", | |
flags: "-Wall -Werror -Wextra -Wpedantic -Wcast-align -Wnon-virtual-dtor -Woverloaded-virtual -Wunused", | |
artifacts-path-postfix: "" | |
} | |
- { | |
name: "Ubuntu Latest clang", | |
os: ubuntu-latest, | |
cc: "clang", | |
cxx: "clang++", | |
cmake_vars: "", | |
asio_type: "standalone", | |
flags: "-Wall -Werror -Wextra -Wpedantic -Wcast-align -Wnon-virtual-dtor -Woverloaded-virtual -Wunused", | |
artifacts-path-postfix: "" | |
} | |
- { | |
name: "Windows Latest MSVC", | |
os: windows-latest, | |
cc: "cl", | |
cxx: "cl", | |
cmake_vars: "", | |
asio_type: "standalone", | |
flags: "/EHsc /W4 /WX", | |
artifacts-path-postfix: "Release" | |
} | |
- { | |
name: "Ubuntu Latest clang (Boost.Asio)", | |
os: ubuntu-latest, | |
cc: "clang", | |
cxx: "clang++", | |
asio_type: "boost", | |
cmake_vars: "-DASYNCGI_USE_BOOST_ASIO=ON -DBoost_USE_STATIC_LIBS=ON -DBoost_USE_STATIC_RUNTIME=ON -DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake", | |
flags: "-Wall -Werror -Wextra -Wpedantic -Wcast-align -Wnon-virtual-dtor -Woverloaded-virtual -Wunused", | |
artifacts-path-postfix: "" | |
} | |
- { | |
name: "Windows Latest MSVC (Boost.Asio)", | |
os: windows-latest, | |
cc: "cl", | |
cxx: "cl", | |
asio_type: "boost", | |
cmake_vars: "-DASYNCGI_USE_BOOST_ASIO=ON -DCMAKE_GENERATOR_PLATFORM=x64 -DVCPKG_TARGET_TRIPLET=x64-windows-static-md -DCMAKE_TOOLCHAIN_FILE='vcpkg/scripts/buildsystems/vcpkg.cmake'", | |
flags: "/EHsc /W4 /WX", | |
artifacts-path-postfix: "Release" | |
} | |
steps: | |
- name: Git checkout | |
uses: actions/checkout@v3 | |
- name: Install vcpkg | |
uses: lukka/run-vcpkg@v10 | |
with: | |
vcpkgGitCommitId: 31a159c1cae2bf905299085d9ef01bdfea0ca7b8 | |
- name: Configure CMake | |
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Release -DENABLE_EXAMPLES=ON ${{ matrix.config.cmake_vars }} -DCMAKE_CXX_FLAGS="${{ matrix.config.flags }}" | |
- name: Build | |
run: cmake --build ${{github.workspace}}/build --config Release | |
- name: Upload build artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: asyncgi-examples-${{ matrix.config.os }}-${{ matrix.config.asio_type }}-asio | |
path: build/examples/${{ matrix.config.artifacts-path-postfix }} | |
- name: Upload build test artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: asyncgi-test-examples-${{ matrix.config.os }}-${{ matrix.config.asio_type }}-asio | |
path: build/test_examples/${{ matrix.config.artifacts-path-postfix }} | |
functional_tests: | |
name: Functional testing (${{ matrix.config.name }} ${{ matrix.asio_type }}-asio) | |
needs: build | |
runs-on: ${{ matrix.config.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
asio_type: [ "standalone", "boost" ] | |
config: | |
- { | |
name: "Windows", | |
os: "windows-latest", | |
lunchtoast_exec: "lunchtoast.exe", | |
shell_command: -shell="msys2 -c", | |
tags: -skip=linux, | |
nginx_exec: "c:/tools/nginx-1.25.2/nginx.exe", | |
nginx_cfg: "nginx_windows.conf" | |
} | |
- { | |
name: "Linux", | |
os: "ubuntu-latest", | |
lunchtoast_exec: "lunchtoast", | |
shell_command: "", | |
tags: "", | |
nginx_exec: "nginx", | |
nginx_cfg: "nginx_linux.conf" | |
} | |
steps: | |
- name: Git checkout | |
uses: actions/checkout@v3 | |
- if: matrix.config.name == 'Windows' | |
name: Install MSYS2 | |
uses: msys2/setup-msys2@v2 | |
with: | |
path-type: inherit | |
- name: Download lunchtoast | |
uses: robinraju/release-downloader@v1.7 | |
with: | |
repository: "kamchatka-volcano/lunchtoast" | |
latest: true | |
filename: ${{ matrix.config.lunchtoast_exec }} | |
out-file-path: "lunchtoast/" | |
- name: Set lunchtoast execute permissions | |
if: matrix.config.name == 'Linux' | |
shell: sh | |
working-directory: ${{github.workspace}}/lunchtoast | |
run: chmod +x lunchtoast | |
- name: Download asyncgi examples build | |
uses: actions/download-artifact@v3 | |
with: | |
name: asyncgi-examples-${{ matrix.config.os }}-${{ matrix.asio_type }}-asio | |
path: build/examples | |
- name: Download asyncgi test_examples build | |
id: pre_launch_tests | |
uses: actions/download-artifact@v3 | |
with: | |
name: asyncgi-test-examples-${{ matrix.config.os }}-${{ matrix.asio_type }}-asio | |
path: build/test_examples | |
- name: Set artifacts execute permissions | |
if: matrix.config.name == 'Linux' | |
shell: sh | |
working-directory: ${{github.workspace}}/build/ | |
run: chmod +x examples/example_* && chmod +x test_examples/test_* | |
- name: Make temp dir for NGINX | |
run: mkdir ${{github.workspace}}/temp | |
- name: Launch tests | |
uses: BerniWittmann/background-server-action@v1 | |
with: | |
command: lunchtoast/lunchtoast functional_tests ${{ matrix.config.shell_command }} ${{ matrix.config.tags }} -collectFailedTests=failed_tests | |
start: ${{ matrix.config.nginx_exec }} -c '${{github.workspace}}'/functional_tests/${{ matrix.config.nginx_cfg }} | |
- name: Upload failed tests | |
if: failure() && steps.launch_tests.outcome != 'success' && steps.pre_launch_tests.outcome == 'success' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: asyncgi-failed-tests-${{ matrix.config.os }} | |
path: failed_tests |