Skip to content

fix: allow GitHash to work with out-of-directory build folders #16

fix: allow GitHash to work with out-of-directory build folders

fix: allow GitHash to work with out-of-directory build folders #16

Workflow file for this run

name: GitHash
on:
push:
branches:
- master
workflow_dispatch:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
# Do not stop all jobs if a single job fails.
fail-fast: false
matrix:
os: [ubuntu-20.04, Windows-2019, macos-11]
build-type: ["Debug", "Release"]
steps:
- name: Checkout repository.
uses: actions/checkout@v4
- name: Create build folder
run: |
mkdir ${{ runner.workspace }}/GitHash/exampleProject/build
- name: Run CMake
working-directory: ${{ runner.workspace }}/GitHash/exampleProject/build
run: |
cmake .. -DCMAKE_BUILD_TYPE=${{ matrix.build-type }}
- name: Build
working-directory: ${{ runner.workspace }}/GitHash/exampleProject/build
run: |
cmake --build . --config ${{ matrix.build-type }} --verbose
- name: Run test
working-directory: ${{ runner.workspace }}/GitHash/exampleProject/build
run: |
ctest -C ${{ matrix.build-type }} -V