Skip to content

add tests to osx build script #357

add tests to osx build script

add tests to osx build script #357

Workflow file for this run

name: CI
on: [push, pull_request]
jobs:
build-and-test-ubuntu:
#if: false # Temporarily disable
name: Build And Test Ubuntu
runs-on: ubuntu-latest
env:
CI_BUILD: 1
IMAGE: ubuntu
IMAGE_TAG: latest
steps:
- uses: actions/checkout@main
# Note only alpine needs "preinstall" step
- name: Update packages
run: sudo -E bash .github/update-packages.sh
- name: Install dependencies
run: |
sudo -E bash .github/install.sh
sudo -E bash .github/install-post.sh
- name: Build and run tests
run: bash .github/build.sh
# Trigger testing of more linux flavors
- name: Trigger linux flavors build
uses: peter-evans/repository-dispatch@v2
with:
event-type: build-linux-flavors
build-and-test-windows:
#if: false # Temporarily disable
name: Build And Test Windows
runs-on: windows-latest
env:
VCPKG_ROOT: ${{ github.workspace }}/vcpkg
steps:
- uses: actions/checkout@main
- uses: lukka/get-cmake@latest
# Setup MSVC command prompt environment vars.
# We must do this before sedtting up our local vcpkg,
# Because it will set VCPKG_ROOT to point to some global
# install of vcpkg, and we don't want that
- uses: ilammy/msvc-dev-cmd@v1
- name: Restore artifacts, setup vcpkg
uses: lukka/run-vcpkg@v11
with:
vcpkgGitCommitId: fba75d09065fcc76a25dcf386b1d00d33f5175af
vcpkgDirectory: '${{ github.workspace }}/vcpkg'
vcpkgJsonGlob: vcpkg.json
runVcpkgInstall: false
- name: vcpkg check / install dependencies
working-directory: '${{ github.workspace }}'
run: '"${{env.VCPKG_ROOT}}\\vcpkg" install --triplet=x64-windows'
shell: cmd
- name: Install dependencies and generate project files
run: |
mkdir build
cd build
cmake -S .. -G Ninja -DBUILD_TESTS=ON -DBUILD_EXAMPLES=ON -DBUILD_TOOLS=ON -DCMAKE_TOOLCHAIN_FILE=${{env.VCPKG_ROOT}}/scripts/buildsystems/vcpkg.cmake
shell: cmd
# Mark all directories as safe so checkouts performed in CMakeLists.txt don't cause "unsafe repository" errors.
# See https://github.com/actions/checkout/issues/766
- name: Configure Git
run: git config --global --add safe.directory '*'
shell: cmd
- name: Build projects
working-directory: '${{ github.workspace }}/build'
run: ninja
shell: cmd
- name: Test crypto
working-directory: '${{ github.workspace }}/build/bin'
run: test_crypto.exe
shell: cmd
- name: Test connection
working-directory: '${{ github.workspace }}/build/bin'
#run: test_connection.exe suite-quick # Loopback throughput test not performing on github hosted runners for some reason
run: test_connection.exe identity quick lane_quick_queueanddrain lane_quick_priority_and_background
shell: cmd
build-and-test-osx:
name: Build And Test for OSX
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Install Vcpkg
run: |
git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh
./vcpkg integrate install
- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: cmake -B ${{github.workspace}}/build
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake
-DBUILD_TESTS=ON
- name: Build
# Build the program with the given configuration
run: cmake --build ${{github.workspace}}/build --config Release
- name: Test
working-directory: ${{github.workspace}}/build
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest -C Release
- name: Test crypto
working-directory: ${{github.workspace}}/build/bin
run: ./test_crypto
shell: bash
- name: Test connection
working-directory: ${{github.workspace}}/build/bin
run: ./test_connection identity quick lane_quick_queueanddrain lane_quick_priority_and_background
shell: bash