Skip to content

Improved handling of FIND_PACKAGE_ARGS in declarations #110

Improved handling of FIND_PACKAGE_ARGS in declarations

Improved handling of FIND_PACKAGE_ARGS in declarations #110

Workflow file for this run

name: build
# This workflow is triggered on PRs ony
on:
pull_request_target:
permissions:
contents: read
env:
GHA_HFC_TOOLS_DIR_CACHE_KEY: 20241128
TIPI_ACCESS_TOKEN: ${{ secrets.HFC_TIPI_TEST_USER_TIPI_ACCESS_TOKEN }}
TIPI_REFRESH_TOKEN: ${{ secrets.HFC_TIPI_TEST_USER_TIPI_REFRESH_TOKEN }}
TIPI_VAULT_PASSPHRASE: ${{ secrets.HFC_TIPI_TEST_USER_TIPI_VAULT_PASSPHRASE }}
jobs:
build:
name: Run HermeticFetchContent tests
runs-on: ubuntu-latest-8-cores
container:
image: tipibuild/tipi-ubuntu:latest
options: --user root
steps:
- name: Compute environment
run: |
echo "TESTS_CACHED_HFC_TOOLS_DIR=$GITHUB_WORKSPACE/shared_hfc_tools_dir" >> $GITHUB_ENV
echo "TESTS_CACHED_HFC_BASEDIR=$GITHUB_WORKSPACE/hfc_project_basedir" >> $GITHUB_ENV
- name: prepare runner
run: |
sudo apt-get update -y
sudo apt install -y gettext
# this will be cached to test execution (e.g. avoid rebuilding goldilock and project dependencies all the time)
mkdir -p $TESTS_CACHED_HFC_TOOLS_DIR
mkdir -p $TESTS_CACHED_HFC_BASEDIR
- name: Cached hfc tools dir
if: ${{ env.build_with_cache == 'true' }}
id: win-cache-build-artifacts-restore
uses: actions/cache@v3
with:
path: |
$TESTS_CACHED_HFC_TOOLS_DIR
$TESTS_CACHED_HFC_BASEDIR
key: ${{ runner.os }}-hfc-project-cache-${{ env.GHA_HFC_TOOLS_DIR_CACHE_KEY }}
restore-keys: |
${{ runner.os }}-hfc-project-cache-
# Checkout the project to the correct location
# note: having two distinct paths here depending on wether or not we're looking at a PR or push to main
#
# This is necessary because we use the pull_request_target which requires a fully specified :ref: config
- name: checkout pull request
uses: actions/checkout@v4
with:
path: './hfc_project'
ref: ${{ github.event.pull_request.head.sha }}
- name: tipi builds project
run: |
cd hfc_project/
mkdir build/
cd build/
# note: separating HFC_TEST_SHARED_TOOLS_DIR and HFC_PROJECT_HFC_BASEDIR to enable
# the tests to use the goldilock that is provided by the main project without being impacted
# be dependencies built for the test project
#
# HERMETIC_FETCHCONTENT_TOOLS_DIR needs to be set to the same value as HFC_TEST_SHARED_TOOLS_DIR
# for this to work
tipi connect
git config --global user.email "hello@tipi.build"
git config --global user.name "tipibuild"
tipi run cmake -DCMAKE_TOOLCHAIN_FILE=toolchain/toolchain.cmake -GNinja -DHERMETIC_FETCHCONTENT_TOOLS_DIR=$TESTS_CACHED_HFC_TOOLS_DIR -DHFC_TEST_SHARED_TOOLS_DIR=$TESTS_CACHED_HFC_TOOLS_DIR -DHFC_PROJECT_HFC_BASEDIR=$TESTS_CACHED_HFC_BASEDIR ..
tipi run cmake --build .
tipi run ctest --verbose