Explorar o código

Adding a continuous integration workflow for Github.

David Piuva hai 10 meses
pai
achega
9ae3050883
Modificáronse 3 ficheiros con 51 adicións e 2 borrados
  1. 21 0
      .github/workflows/ci.yml
  2. 20 0
      .github/workflows/ci.yml.tabs
  3. 10 2
      Source/test.sh

+ 21 - 0
.github/workflows/ci.yml

@@ -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 - 0
.github/workflows/ci.yml.tabs

@@ -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

+ 10 - 2
Source/test.sh

@@ -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;
@@ -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