Skip to content

test

test #43

Workflow file for this run

on: push
name: CI
jobs:
diff:
name: diff
runs-on: ubuntu-latest
strategy:
matrix:
project: # Filter , compilation path
- ['src.*one.*cpp', /src/one]
- ['src.*two.*cpp', /src/two]
steps:
# Prepare project repository.
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 2 # We need to fetch 2 commits to get the diff.
- name: Check for compilation requirement
run: |
DIFFS=$(git diff --name-only HEAD HEAD~1)
echo "$DIFFS | grep -q ${{ matrix.project[0] }}"
if $?; then
echo "COMPILATION_FLAG=true" >> $GITHUB_ENV
else
echo "COMPILATION_FLAG=false" >> $GITHUB_ENV
fi
- name: Build Project
if: ${{ env.COMPILATION_FLAG == 'true' }}
run: |
echo "cd ${{ matrix.project[1] }}"
echo "mkdir build"
echo "cd build"
echo "cmake .."
echo "make"