From 60ec33223e7787f86420800ac44a8acb9e91b05a Mon Sep 17 00:00:00 2001 From: user19870 <87924678+user19870@users.noreply.github.com> Date: Tue, 23 Dec 2025 22:05:36 +0800 Subject: [PATCH 01/11] Update build commands and artifact name in workflow --- .github/workflows/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3ab87d5..2f333f9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -22,13 +22,13 @@ jobs: - name: Compile run: | if [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then - g++ cppsp_compiler.cpp -Os -s -std=c++17 -o cppsp_compiler_linux + g++ cppsp_compiler.cpp -static -Os -s -std=c++17 -o cppsp_compiler_linux else - clang++ cppsp_compiler.cpp -Os -s -std=c++17 -o cppsp_compiler_mac + clang++ cppsp_compiler.cpp -static -Os -s -std=c++17 -o cppsp_compiler_mac fi - name: Upload artifact uses: actions/upload-artifact@v4 with: - name: ${{ matrix.os }}-binary + name: binary path: cppsp_compiler_* From 0fdcf55a70bf295a2168549cd06086a64ab317dc Mon Sep 17 00:00:00 2001 From: user19870 <87924678+user19870@users.noreply.github.com> Date: Tue, 23 Dec 2025 22:07:50 +0800 Subject: [PATCH 02/11] Remove unnecessary flags from compiler commands --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2f333f9..15822c9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -22,9 +22,9 @@ jobs: - name: Compile run: | if [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then - g++ cppsp_compiler.cpp -static -Os -s -std=c++17 -o cppsp_compiler_linux + g++ cppsp_compiler.cpp -static -Os -std=c++17 -o cppsp_compiler_linux else - clang++ cppsp_compiler.cpp -static -Os -s -std=c++17 -o cppsp_compiler_mac + clang++ cppsp_compiler.cpp -static -Os -std=c++17 -o cppsp_compiler_mac fi - name: Upload artifact From 9216dac28d42bbd7b1afa0124b0f151fb471962a Mon Sep 17 00:00:00 2001 From: user19870 <87924678+user19870@users.noreply.github.com> Date: Tue, 23 Dec 2025 22:11:47 +0800 Subject: [PATCH 03/11] Refactor compiler installation and compilation steps Updated compiler installation and compilation commands for better optimization. --- .github/workflows/main.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 15822c9..2339c50 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,16 +15,16 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Install compiler (Linux) - if: matrix.os == 'ubuntu-latest' - run: sudo apt-get update && sudo apt-get install -y g++ + # - name: Install compiler (Linux) + # if: matrix.os == 'ubuntu-latest' + #run: sudo apt-get update && sudo apt-get install -y g++ - name: Compile run: | if [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then - g++ cppsp_compiler.cpp -static -Os -std=c++17 -o cppsp_compiler_linux + g++ cppsp_compiler.cpp -Os -s -std=c++17 -o cppsp_compiler_linux -static else - clang++ cppsp_compiler.cpp -static -Os -std=c++17 -o cppsp_compiler_mac + clang++ cppsp_compiler.cpp -Os -s -std=c++17 -o cppsp_compiler_mac -static fi - name: Upload artifact From 7c09abf353ac9f7d394d6fd1fbec62f4a7343b54 Mon Sep 17 00:00:00 2001 From: user19870 <87924678+user19870@users.noreply.github.com> Date: Tue, 23 Dec 2025 22:17:00 +0800 Subject: [PATCH 04/11] Update GitHub Actions workflow for compile branch --- .github/workflows/main.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2339c50..7851574 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,9 +1,10 @@ name: build-cpp on: - push: - pull_request: - + push: + branches: [compile] + pull_request: + branches: [compile] jobs: build: strategy: @@ -24,7 +25,7 @@ jobs: if [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then g++ cppsp_compiler.cpp -Os -s -std=c++17 -o cppsp_compiler_linux -static else - clang++ cppsp_compiler.cpp -Os -s -std=c++17 -o cppsp_compiler_mac -static + clang++ cppsp_compiler.cpp -Os -s -std=c++17 -o cppsp_compiler_mac -static fi - name: Upload artifact From 8abe8747bca991b6af1a4be4cef4e2c52a3dd32d Mon Sep 17 00:00:00 2001 From: user19870 <87924678+user19870@users.noreply.github.com> Date: Tue, 23 Dec 2025 22:19:29 +0800 Subject: [PATCH 05/11] Refactor compilation commands in CI workflow Fix compilation command for macOS by removing redundant flags. --- .github/workflows/main.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7851574..16499cb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -22,11 +22,11 @@ jobs: - name: Compile run: | - if [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then - g++ cppsp_compiler.cpp -Os -s -std=c++17 -o cppsp_compiler_linux -static + if [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then + g++ cppsp_compiler.cpp -Os -s -std=c++17 -o cppsp_compiler_linux -static else - clang++ cppsp_compiler.cpp -Os -s -std=c++17 -o cppsp_compiler_mac -static - fi + clang++ cppsp_compiler.cpp -Os -std=c++17 -o cppsp_compiler_mac + fi - name: Upload artifact uses: actions/upload-artifact@v4 From 9a85153101b8bdbe14115c83dae00e6beaf24f66 Mon Sep 17 00:00:00 2001 From: user19870 <87924678+user19870@users.noreply.github.com> Date: Tue, 23 Dec 2025 22:22:50 +0800 Subject: [PATCH 06/11] Change artifact upload to zip binaries Updated artifact upload process to zip binaries for Linux and Mac. --- .github/workflows/main.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 16499cb..80db6e8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -29,7 +29,6 @@ jobs: fi - name: Upload artifact - uses: actions/upload-artifact@v4 - with: - name: binary - path: cppsp_compiler_* + if: matrix.os == 'ubuntu-latest' + run: | + zip binaries.zip cppsp_compiler_linux cppsp_compiler_mac From 00ed18416b391227b028df3b2e11b513927164bc Mon Sep 17 00:00:00 2001 From: user19870 <87924678+user19870@users.noreply.github.com> Date: Tue, 23 Dec 2025 22:27:39 +0800 Subject: [PATCH 07/11] Add artifact upload step for binaries --- .github/workflows/main.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 80db6e8..8540940 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -32,3 +32,8 @@ jobs: if: matrix.os == 'ubuntu-latest' run: | zip binaries.zip cppsp_compiler_linux cppsp_compiler_mac + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: binary + path: bin From 75692937b406e5ba936160d9e87fcf99afe595ab Mon Sep 17 00:00:00 2001 From: user19870 <87924678+user19870@users.noreply.github.com> Date: Tue, 23 Dec 2025 22:29:28 +0800 Subject: [PATCH 08/11] Update artifact upload path in workflow --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8540940..e0728c3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -36,4 +36,4 @@ jobs: uses: actions/upload-artifact@v4 with: name: binary - path: bin + path: cppsp_compiler_* From 340546062066bde26e5eb64c34ab5f701970d6d9 Mon Sep 17 00:00:00 2001 From: user19870 <87924678+user19870@users.noreply.github.com> Date: Tue, 23 Dec 2025 22:30:30 +0800 Subject: [PATCH 09/11] Change artifact upload path to binaries.zip --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e0728c3..e14b3a2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -36,4 +36,4 @@ jobs: uses: actions/upload-artifact@v4 with: name: binary - path: cppsp_compiler_* + path: binaries.zip From f2ad9195bd0df98862099e359bccd3acc0e0a10d Mon Sep 17 00:00:00 2001 From: user19870 <87924678+user19870@users.noreply.github.com> Date: Tue, 23 Dec 2025 22:33:50 +0800 Subject: [PATCH 10/11] Refactor artifact upload step in workflow --- .github/workflows/main.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e14b3a2..79e320f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -28,12 +28,9 @@ jobs: clang++ cppsp_compiler.cpp -Os -std=c++17 -o cppsp_compiler_mac fi - - name: Upload artifact - if: matrix.os == 'ubuntu-latest' - run: | - zip binaries.zip cppsp_compiler_linux cppsp_compiler_mac + - name: Upload artifact uses: actions/upload-artifact@v4 with: - name: binary - path: binaries.zip + name: ${{ matrix.os }}-binary + path: cppsp_compiler_* From fe0d8b9ea426e1f2940530aad0ffcb4820ee9a10 Mon Sep 17 00:00:00 2001 From: user19870 <87924678+user19870@users.noreply.github.com> Date: Tue, 23 Dec 2025 22:43:46 +0800 Subject: [PATCH 11/11] Rename build job to compile in workflow --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 79e320f..b08c6b0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -6,7 +6,7 @@ on: pull_request: branches: [compile] jobs: - build: + compile: strategy: matrix: os: [ubuntu-latest, macos-latest]