Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a continuous integration workflow for Github #130

Merged
merged 1 commit into from
Jan 26, 2025
Merged
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
21 changes: 21 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# See ci.yml.tabs for the properly indented version if you are having trouble seeing the indentation in this file.
# This version is only for Github to parse.
name: DFPSR tests
on: [push]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
architecture: [x86_32, x86_64]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run tests
run: |
cd ./Source
if [[ "${{ matrix.architecture }}" == "x86_32" ]]; then
./test.sh
elif [[ "${{ matrix.architecture }}" == "x86_64" ]]; then
./test.sh
fi
20 changes: 20 additions & 0 deletions .github/workflows/ci.yml.tabs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Indentation adjustable version for accessible reading.
name: DFPSR tests
on: [push]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
architecture: [x86_32, x86_64]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run tests
run: |
cd ./Source
if [[ "${{ matrix.architecture }}" == "x86_32" ]]; then
./test.sh
elif [[ "${{ matrix.architecture }}" == "x86_64" ]]; then
./test.sh
fi
12 changes: 10 additions & 2 deletions Source/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,17 @@ for file in ./test/tests/*.cpp; do
# Compile test case that defines main
echo "Compiling ${name}";
g++ ${CPP_VERSION} ${MODE} ${DEBUGGER} -c ${file} -o ${TEMP_DIR}/${base}_test.o;
if [ $? -ne 0 ]
then
exit 1
fi
# Linking with frameworks
echo "Linking ${name}";
g++ ${TEMP_DIR}/*.o ${TEMP_DIR}/*.a -lm -pthread -o ${TEMP_DIR}/application;
if [ $? -ne 0 ]
then
exit 1
fi
# Run the test case
echo "Executing ${name}";
./${TEMP_DIR}/application;
Expand All @@ -44,8 +52,8 @@ for file in ./test/tests/*.cpp; do
else
echo "Failed ${name}!";
# Re-run with a memory debugger.
gdb ./${TEMP_DIR}/application;
break;
#gdb ./${TEMP_DIR}/application;
exit 1
fi
done

Loading