Skip to content

Set CMAKE_TOOLCHAIN_FILE #269

Set CMAKE_TOOLCHAIN_FILE

Set CMAKE_TOOLCHAIN_FILE #269

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
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@v10
with:
vcpkgGitCommitId: e809a42f87565e803b2178a0c11263f462d1800a
vcpkgDirectory: '${{env.VCPKG_ROOT}}'
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-flavors:
#if: false # Temporarily disable
name: Build And Test Unix Flavors
runs-on: ${{ matrix.os }}
needs: build-and-test-ubuntu # Don't both running flavors until after ubuntu has passed
strategy:
matrix:
include:
- build: ubuntu-bionic
os: ubuntu-latest
docker_image: ubuntu
docker_tag: bionic
#- build: ubuntu-latest
# os: ubuntu-latest
# docker_image: ubuntu
# docker_tag: latest
- build: ubuntu-rolling
os: ubuntu-latest
docker_image: ubuntu
docker_tag: rolling
#- build: ubuntu-devel
# os: ubuntu-latest
# docker_image: ubuntu
# docker_tag: devel
- build: fedora-latest
os: ubuntu-latest
docker_image: fedora
docker_tag: latest
#- build: archlinux-latest
# os: ubuntu-latest
# docker_image: archlinux
# docker_tag: latest
- build: alpine-latest
os: ubuntu-latest
docker_image: alpine
docker_tag: latest
steps:
- uses: actions/checkout@main
- name: Launch container
run: |
docker run -d --rm --name github-docker-builder -e LC_ALL="C" -e LANG="C" -v ${{ github.workspace }}:/build -w /build ${{ matrix.docker_image }}:${{ matrix.docker_tag }} tail -f /dev/null
docker ps
docker exec -e CI_BUILD=1 -e IMAGE=${{ matrix.docker_image }} -e IMAGE_TAG=${{ matrix.docker_tag }} -t github-docker-builder sh .github/preinstall.sh
- name: Update packages
run: |
docker exec -e CI_BUILD=1 -e IMAGE=${{ matrix.docker_image }} -e IMAGE_TAG=${{ matrix.docker_tag }} -t github-docker-builder bash .github/update-packages.sh
- name: Install dependencies
run: |
docker exec -e CI_BUILD=1 -e IMAGE=${{ matrix.docker_image }} -e IMAGE_TAG=${{ matrix.docker_tag }} -t github-docker-builder bash .github/install.sh
docker exec -e CI_BUILD=1 -e IMAGE=${{ matrix.docker_image }} -e IMAGE_TAG=${{ matrix.docker_tag }} -t github-docker-builder bash .github/install-post.sh
- name: Build and run project
run: |
docker exec -e CI_BUILD=1 -e IMAGE=${{ matrix.docker_image }} -e IMAGE_TAG=${{ matrix.docker_tag }} -t github-docker-builder bash .github/build.sh