-fixed artifact collection on CI; #189
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, MSVC) | |
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 20.04 gcc", | |
os: ubuntu-20.04, | |
cmake_vars: "-DBoost_USE_STATIC_LIBS=ON -DBoost_USE_STATIC_RUNTIME=ON", | |
cmake-preset: gcc-release, | |
artifacts: "build/lunchtoast" | |
} | |
- { | |
name: "Ubuntu 20.04 clang", | |
os: ubuntu-20.04, | |
cmake_vars: "-DBoost_USE_STATIC_LIBS=ON -DBoost_USE_STATIC_RUNTIME=ON", | |
cmake-preset: clang-release, | |
artifacts: "build/lunchtoast" | |
} | |
- { | |
name: "Windows Latest MSVC", | |
os: windows-2019, | |
cmake_vars: "-DVCPKG_TARGET_TRIPLET=x64-windows-static-md", | |
cmake-preset: msvc-release, | |
artifacts: "build/lunchtoast.exe" | |
} | |
steps: | |
- name: Install ninja (Windows) | |
if: matrix.config.os == 'windows-2019' | |
run: choco install ninja | |
- name: Install ninja (Linux) | |
if: matrix.config.os == 'ubuntu-20.04' | |
run: sudo apt install ninja-build | |
- uses: actions/checkout@v4 | |
- uses: hendrikmuhs/ccache-action@v1.2 | |
- uses: ilammy/msvc-dev-cmd@v1 | |
- uses: lukka/run-vcpkg@v10 | |
with: | |
vcpkgGitCommitId: 31a159c1cae2bf905299085d9ef01bdfea0ca7b8 | |
- name: Configure CMake | |
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Release -DENABLE_TESTS=ON ${{ matrix.config.cmake_vars }} -DCMAKE_TOOLCHAIN_FILE=${{github.workspace}}/vcpkg/scripts/buildsystems/vcpkg.cmake --preset="${{ matrix.config.cmake-preset }}" | |
- name: Build | |
run: cmake --build ${{github.workspace}}/build --config Release | |
- name: Test | |
working-directory: ${{github.workspace}}/build | |
run: ctest | |
- name: Upload build artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: lunchtoast-build-${{ matrix.config.os }} | |
path: ${{ matrix.config.artifacts }} | |
functional_test_windows: | |
name: Functional testing (Windows) | |
needs: build | |
runs-on: windows-2019 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: msys2/setup-msys2@v2 | |
with: | |
path-type: inherit | |
- uses: robinraju/release-downloader@v1.7 | |
with: | |
repository: "kamchatka-volcano/lunchtoast" | |
latest: true | |
#tag: "v0.1.0-beta" | |
filename: "lunchtoast.exe" | |
out-file-path: "master" | |
- name: Download lunchtoast build | |
id: pre_launch_tests | |
uses: actions/download-artifact@v3 | |
with: | |
name: lunchtoast-build-windows-2019 | |
path: build | |
- name: Launch tests | |
id: launch_tests | |
working-directory: ${{github.workspace}} | |
run: master/lunchtoast.exe functional_tests -skip=linux -shell="msys2 -c" -collectFailedTests=failed_tests -config="windows_vars.shoal" -searchDepth=1 | |
- name: Upload failed tests | |
if: failure() && steps.launch_tests.outcome != 'success' && steps.pre_launch_tests.outcome == 'success' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: lunchtoast-windows-failed-tests | |
path: failed_tests | |
functional_test_linux: | |
name: Functional testing (Ubuntu) | |
needs: build | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: robinraju/release-downloader@v1.7 | |
with: | |
repository: "kamchatka-volcano/lunchtoast" | |
latest: true | |
#tag: "v0.1.0-beta" | |
filename: "lunchtoast" | |
out-file-path: "master" | |
- name: Set master lunchtoast execute permissions | |
shell: sh | |
working-directory: ${{github.workspace}}/master | |
run: chmod +x lunchtoast | |
- name: Download lunchtoast build | |
uses: actions/download-artifact@v3 | |
with: | |
name: lunchtoast-build-ubuntu-20.04 | |
path: build | |
- name: Set lunchtoast build execute permissions | |
id: pre_launch_tests | |
shell: sh | |
working-directory: ${{github.workspace}}/build | |
run: chmod +x lunchtoast | |
- name: Launch tests | |
id: launch_tests | |
working-directory: ${{github.workspace}}/ | |
run: master/lunchtoast functional_tests/ -skip=windows -collectFailedTests=failed_tests -config=linux_vars.shoal -searchDepth=1 | |
- name: Upload failed tests | |
if: failure() && steps.launch_tests.outcome != 'success' && steps.pre_launch_tests.outcome == 'success' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: lunchtoast-ubuntu-failed-tests | |
path: failed_tests |