Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,11 @@ jobs:
uses: open-education-hub/actions/spellcheck@main
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

solutions-CI:
name: Solutions CI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Solutions CI
run: ./util/test-gen-lab-support.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ SCRIPT = generate_skels.py

skels:
mkdir -p support/src
$(PYTHON) $(SCRIPT) --input ./solution/src --output ./support/src
$(PYTHON) $(SCRIPT) --input ./solution/src2 --output ./support/src
$(PYTHON) $(SCRIPT) --input ./solution/tests --output ./support/tests

clean:
Expand Down
25 changes: 25 additions & 0 deletions util/test-gen-lab-support.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

Check failure on line 2 in util/test-gen-lab-support.sh

View workflow job for this annotation

GitHub Actions / Checkpatch

WARNING:SPDX_LICENSE_TAG: Missing or malformed SPDX-License-Identifier tag in line 2
### This script ensures that the lab support files are generated successfully.
# Usage: ./check-lab-solution.sh

REPO_ROOT=$(git rev-parse --show-toplevel)
fails=()

MAKEFILES=$(grep -rl "skels:" $(find $REPO_ROOT -name Makefile))
for makefile in $MAKEFILES; do
make -C $(dirname $makefile) skels 2>&1 >/dev/null
if [ $? -ne 0 ]; then
fails+=($makefile)
fi
done

if [ ${#fails[@]} -ne 0 ]; then
echo "The following Makefiles failed to generate the lab support files:"
for fail in ${fails[@]}; do
echo " $fail"
done
exit 1
fi

echo "All lab support files generated successfully."
Loading