From 4b3531524ba310b7e5e86cf9ee7921c42d05b4e4 Mon Sep 17 00:00:00 2001 From: jose-rZM <100773386+jose-rZM@users.noreply.github.com> Date: Sat, 13 Jun 2026 18:38:10 +0200 Subject: [PATCH 1/3] chore: change artifact naming --- .github/workflows/main.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f1c2756..302e4d2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -128,7 +128,7 @@ jobs: - name: Create ZIP of .app run: | - ditto -c -k --keepParent .bin/SyntaxTutor.app SyntaxTutor-${{ steps.version.outputs.value }}-macos-x86_64.zip + cd .bin && ditto -c -k --keepParent SyntaxTutor.app ../SyntaxTutor-${{ steps.version.outputs.value }}-macos-x86_64.zip - name: Upload artifact uses: actions/upload-artifact@v4 @@ -243,7 +243,7 @@ jobs: - name: Create ZIP of .app (arm64) run: | - zip -qry SyntaxTutor-${{ steps.version.outputs.value }}-macos-arm64.zip .bin/SyntaxTutor.app + cd .bin && zip -qry ../SyntaxTutor-${{ steps.version.outputs.value }}-macos-arm64.zip SyntaxTutor.app - name: Upload artifacts uses: actions/upload-artifact@v4 @@ -300,7 +300,10 @@ jobs: windeployqt --release .\deploy\SyntaxTutor.exe --dir deploy - name: Zip Windows bundle - run: powershell Compress-Archive -Path deploy -DestinationPath SyntaxTutor-${{ steps.version.outputs.value }}-windows-x64.zip + shell: pwsh + run: | + Rename-Item deploy SyntaxTutor + Compress-Archive -Path SyntaxTutor -DestinationPath SyntaxTutor-${{ steps.version.outputs.value }}-windows-x64.zip - name: Upload zipped Windows bundle uses: actions/upload-artifact@v4 From 692d21f8e4267dc808f76585d17b6facf6c91e7e Mon Sep 17 00:00:00 2001 From: jose-rZM <100773386+jose-rZM@users.noreply.github.com> Date: Sat, 13 Jun 2026 19:17:37 +0200 Subject: [PATCH 2/3] chore: add generic makefile --- GNUmakefile | 64 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 GNUmakefile diff --git a/GNUmakefile b/GNUmakefile new file mode 100644 index 0000000..05002dd --- /dev/null +++ b/GNUmakefile @@ -0,0 +1,64 @@ +BUILD_DIR = build +APP_BUILD = $(BUILD_DIR)/app +TEST_BUILD = $(BUILD_DIR)/tests +CORE_BUILD = $(BUILD_DIR)/core +QMAKE = qmake6 +JOBS = $(shell nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 4) +CXX ?= g++ + +# Locate gtest via pkg-config, then common brew/system paths +GTEST_CFLAGS := $(shell pkg-config --cflags gtest 2>/dev/null) +GTEST_LIBS := $(shell pkg-config --libs gtest gtest_main 2>/dev/null) +ifeq ($(GTEST_LIBS),) + GTEST_PREFIX := $(shell brew --prefix googletest 2>/dev/null) + ifneq ($(GTEST_PREFIX),) + GTEST_CFLAGS := -I$(GTEST_PREFIX)/include + GTEST_LIBS := -L$(GTEST_PREFIX)/lib -lgtest -lgtest_main + else + GTEST_CFLAGS := -I/usr/include + GTEST_LIBS := -lgtest -lgtest_main -lpthread + endif +endif + +BACKEND_SRCS = \ + src/backend/grammar.cpp \ + src/backend/grammar_factory.cpp \ + src/backend/grammar_parser.cpp \ + src/backend/ll1_parser.cpp \ + src/backend/lr0_item.cpp \ + src/backend/slr1_parser.cpp \ + src/backend/symbol_table.cpp \ + src/backend/tests.cpp + +.PHONY: all app tests core check check-core check-ui clean + +all: app tests core + +app: + mkdir -p $(APP_BUILD) + cd $(APP_BUILD) && $(QMAKE) $(CURDIR)/SyntaxTutor.pro CONFIG+=release + $(MAKE) -C $(APP_BUILD) -j$(JOBS) + +tests: + mkdir -p $(TEST_BUILD) + cd $(TEST_BUILD) && $(QMAKE) $(CURDIR)/tests/tests.pro + $(MAKE) -C $(TEST_BUILD) -j$(JOBS) + +core: + mkdir -p $(CORE_BUILD) + $(CXX) -std=gnu++2a -O2 -Isrc/backend \ + $(GTEST_CFLAGS) \ + $(BACKEND_SRCS) \ + $(GTEST_LIBS) \ + -o $(CORE_BUILD)/core_tests + +check: check-core check-ui + +check-core: core + $(CORE_BUILD)/core_tests + +check-ui: tests + QT_QPA_PLATFORM=offscreen $(TEST_BUILD)/.bin/tutor_tests + +clean: + rm -rf $(BUILD_DIR) From ae01b610e87d361d3129e74006a1b48693b2ad8f Mon Sep 17 00:00:00 2001 From: jose-rZM <100773386+jose-rZM@users.noreply.github.com> Date: Sat, 13 Jun 2026 19:18:06 +0200 Subject: [PATCH 3/3] chore: change sonarcloud workflow --- .github/workflows/sonarcloud.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index 22e3ea9..257264a 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -50,16 +50,15 @@ jobs: run: ./test_runner - name: Build Qt tests - working-directory: tests run: | - qmake6 tests.pro - make -j"$(nproc)" + mkdir -p build/tests + cd build/tests && qmake6 $GITHUB_WORKSPACE/tests/tests.pro + make -C build/tests -j"$(nproc)" - name: Run Qt tests - working-directory: tests env: QT_QPA_PLATFORM: offscreen - run: ./.bin/tutor_tests + run: build/tests/.bin/tutor_tests - name: Install gcovr & generate SonarQube XML coverage run: |