Skip to content

install dev environment #5

install dev environment

install dev environment #5

Workflow file for this run

#
# .github/workflows/build-on-unix.yml
#
# Copyright 2021 Jens A. Koch.
# SPDX-License-Identifier: BSL-1.0
# This file is part of hikogui.
#
name: "Build on UNIX"
on:
push:
branches:
- main
pull_request:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
build-and-test:
name: x64-linux
runs-on: ubuntu-latest
env:
DEBUG_BUILD_DIR: ${{github.workspace}}/out/build/x64-linux/Debug
RELEASE_BUILD_DIR: ${{github.workspace}}/out/build/x64-linux/Release
INSTALL_DIR: ${{github.workspace}}/out/install
VCPKG_ROOT: ${{github.workspace}}/vcpkg
VCPKG_DEFAULT_BINARY_CACHE: ${{github.workspace}}/vcpkg/binary-sources
VCPKG_BINARY_SOURCES: clear;file,${{github.workspace}}/vcpkg/binary-sources,readwrite
VCPKG_FEATURE_FLAGS: binarycaching
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install development environment
run: |
sudo apt-get update
sudo apt-get install -y perl autoconf-archive ninja-build cmake pkg-config
- name: Create vcpkg cache dir
run: mkdir ${{env.VCPKG_DEFAULT_BINARY_CACHE}}
- name: Get vcpkg commit id
working-directory: vcpkg
run: git rev-parse HEAD >commit.txt
- name: Install vcpkg
working-directory: vcpkg
run: ./bootstrap-vcpkg.sh
- name: Restore vcpkg binary-cache
id: restore-vcpkg-cache
uses: actions/cache/restore@v4
with:
path: vcpkg/binary-sources/**/*.zip
key: vcpkg-cache-${{hashFiles('vcpkg.json', 'vcpkg/commit.txt')}}
- name: CMake - Configure
run: cmake --preset=x64-linux .
- name: Save vcpkg binary-cache
uses: actions/cache/save@v4
id: save-vcpkg-cache
if: always() && steps.restore-vcpkg-cache.outputs.cache-hit != 'true'
with:
path: vcpkg/binary-sources/**/*.zip
key: ${{steps.restore-vcpkg-cache.outputs.cache-primary-key}}
- name: CMake - Build (Debug)
run: cmake --build --preset=x64-linux-dbg --parallel 1 .
- name: CMake - Build (Release)
run: cmake --build --preset=x64-linux-rel --parallel 1 .
- name: Run tests (Debug)
working-directory: ${{env.DEBUG_BUILD_DIR}}
run: ./hktests-dbg --gtest_output=xml:hktests-dbg.xml
- name: Run tests (Release)
working-directory: ${{env.RELEASE_BUILD_DIR}}
run: ./hktests-rel --gtest_output=xml:hktests-rel.xml