From 1c4683da8eab162d64619283d2011ea165f26923 Mon Sep 17 00:00:00 2001 From: Chris Dedman Rollet <61106361+chrisdedman@users.noreply.github.com> Date: Fri, 21 Mar 2025 19:43:52 -0700 Subject: [PATCH 1/8] [CI] Inital CI implementation Implement first version of GitHub Action CI for cross-platform testing --- .github/workflows/cpp.yml | 72 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 .github/workflows/cpp.yml diff --git a/.github/workflows/cpp.yml b/.github/workflows/cpp.yml new file mode 100644 index 0000000..2356b05 --- /dev/null +++ b/.github/workflows/cpp.yml @@ -0,0 +1,72 @@ +name: C++ CI + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + + steps: + - uses: actions/checkout@v4 + + # Install C++ Compiler & Build Tools + - name: Set up C++ environment (Ubuntu) + if: matrix.os == 'ubuntu-latest' + run: | + sudo apt-get update + sudo apt-get install -y g++ make cmake + sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 100 + g++ --version + cmake --version + make --version + + - name: Set up C++ environment (macOS) + if: matrix.os == 'macos-latest' + run: | + brew install gcc make cmake + echo 'export PATH="/usr/local/opt/gcc/bin:$PATH"' >> ~/.bash_profile + source ~/.bash_profile + g++ --version + cmake --version + make --version + + - name: Set up C++ environment (Windows) + if: matrix.os == 'windows-latest' + run: | + choco install mingw --version=8.1.0-1 + choco install make cmake + echo C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + echo C:\ProgramData\chocolatey\lib\cmake\bin | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + g++ --version + cmake --version + make --version + + # Install Qt6 + - name: Install Qt6 (Ubuntu) + if: matrix.os == 'ubuntu-latest' + run: | + sudo apt-get install -y qt6-base-dev + + - name: Install Qt6 (macOS) + if: matrix.os == 'macos-latest' + run: | + brew install qt6 + echo 'export PATH="/opt/homebrew/opt/qt6/bin:$PATH"' >> ~/.bash_profile + source ~/.bash_profile + + - name: Install Qt6 (Windows) + if: matrix.os == 'windows-latest' + run: | + choco install qt6 --version=6.2.4 + echo C:\Qt\6.2.4\msvc2019_64\bin | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + + # Build the Project + - name: Build project + run: make From 20cdcdedc1817f6579db673e34b5b98803165d8e Mon Sep 17 00:00:00 2001 From: Chris Dedman Rollet <61106361+chrisdedman@users.noreply.github.com> Date: Fri, 21 Mar 2025 19:50:05 -0700 Subject: [PATCH 2/8] [CI] Fix bug on Ubuntu --- .github/workflows/cpp.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/cpp.yml b/.github/workflows/cpp.yml index 2356b05..de91346 100644 --- a/.github/workflows/cpp.yml +++ b/.github/workflows/cpp.yml @@ -22,7 +22,6 @@ jobs: run: | sudo apt-get update sudo apt-get install -y g++ make cmake - sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 100 g++ --version cmake --version make --version @@ -30,7 +29,7 @@ jobs: - name: Set up C++ environment (macOS) if: matrix.os == 'macos-latest' run: | - brew install gcc make cmake + brew install make cmake echo 'export PATH="/usr/local/opt/gcc/bin:$PATH"' >> ~/.bash_profile source ~/.bash_profile g++ --version From 64ce837162af1d219b9a70c4ea14a7b9766202fa Mon Sep 17 00:00:00 2001 From: Chris Dedman Rollet <61106361+chrisdedman@users.noreply.github.com> Date: Fri, 21 Mar 2025 19:53:01 -0700 Subject: [PATCH 3/8] [CI] Bug Fix second attempt --- .github/workflows/cpp.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cpp.yml b/.github/workflows/cpp.yml index de91346..fc1e907 100644 --- a/.github/workflows/cpp.yml +++ b/.github/workflows/cpp.yml @@ -52,6 +52,8 @@ jobs: if: matrix.os == 'ubuntu-latest' run: | sudo apt-get install -y qt6-base-dev + echo 'export PATH="/usr/lib/qt6/bin:$PATH"' >> ~/.bashrc + source ~/.bashrc - name: Install Qt6 (macOS) if: matrix.os == 'macos-latest' @@ -59,13 +61,16 @@ jobs: brew install qt6 echo 'export PATH="/opt/homebrew/opt/qt6/bin:$PATH"' >> ~/.bash_profile source ~/.bash_profile + qmake --version - name: Install Qt6 (Windows) if: matrix.os == 'windows-latest' run: | - choco install qt6 --version=6.2.4 - echo C:\Qt\6.2.4\msvc2019_64\bin | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + Invoke-WebRequest -Uri "https://download.qt.io/official_releases/online_installers/qt-unified-windows-x64-online.exe" -OutFile "qt-installer.exe" + Start-Process -FilePath ".\qt-installer.exe" -ArgumentList "--silent", "--platform minimal", "--accept-licenses", "--default-answer" -NoNewWindow -Wait + echo C:\Qt\6.6.0\msvc2019_64\bin | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + qmake --version # Build the Project - name: Build project - run: make + run: make build From 9650369be5b7e8c8c3c8516920b32dce1da4f370 Mon Sep 17 00:00:00 2001 From: Chris Dedman Rollet <61106361+chrisdedman@users.noreply.github.com> Date: Fri, 21 Mar 2025 19:59:01 -0700 Subject: [PATCH 4/8] [CI] Added installation and try fix window error --- .github/workflows/cpp.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cpp.yml b/.github/workflows/cpp.yml index fc1e907..68d16b8 100644 --- a/.github/workflows/cpp.yml +++ b/.github/workflows/cpp.yml @@ -66,11 +66,15 @@ jobs: - name: Install Qt6 (Windows) if: matrix.os == 'windows-latest' run: | - Invoke-WebRequest -Uri "https://download.qt.io/official_releases/online_installers/qt-unified-windows-x64-online.exe" -OutFile "qt-installer.exe" - Start-Process -FilePath ".\qt-installer.exe" -ArgumentList "--silent", "--platform minimal", "--accept-licenses", "--default-answer" -NoNewWindow -Wait - echo C:\Qt\6.6.0\msvc2019_64\bin | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + python -m pip install aqtinstall + python -m aqt install-qt windows desktop 6.6.0 win64_mingw --outputdir C:\Qt + echo C:\Qt\6.6.0\mingw_64\bin | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append qmake --version # Build the Project - name: Build project run: make build + + # Install the Project with desktop shortcut + - name: Install project + run: echo "y" | make install From 38c9317adcd0b6ad1f4251717d538382bd1546ed Mon Sep 17 00:00:00 2001 From: Chris Dedman Rollet <61106361+chrisdedman@users.noreply.github.com> Date: Fri, 21 Mar 2025 20:11:42 -0700 Subject: [PATCH 5/8] [CI] fix bug on errors --- .github/workflows/cpp.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cpp.yml b/.github/workflows/cpp.yml index 68d16b8..3cbd8e1 100644 --- a/.github/workflows/cpp.yml +++ b/.github/workflows/cpp.yml @@ -12,6 +12,9 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest, macos-latest] + fail-fast: false + + continue-on-error: true steps: - uses: actions/checkout@v4 @@ -61,7 +64,6 @@ jobs: brew install qt6 echo 'export PATH="/opt/homebrew/opt/qt6/bin:$PATH"' >> ~/.bash_profile source ~/.bash_profile - qmake --version - name: Install Qt6 (Windows) if: matrix.os == 'windows-latest' @@ -69,7 +71,6 @@ jobs: python -m pip install aqtinstall python -m aqt install-qt windows desktop 6.6.0 win64_mingw --outputdir C:\Qt echo C:\Qt\6.6.0\mingw_64\bin | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - qmake --version # Build the Project - name: Build project From 923f2ea06ee518cb0c8ff6892db77be9a34e64ae Mon Sep 17 00:00:00 2001 From: Chris Dedman Rollet <61106361+chrisdedman@users.noreply.github.com> Date: Fri, 21 Mar 2025 20:16:45 -0700 Subject: [PATCH 6/8] [CI Bug] Fix bug on windows python version + linux install work around --- .github/workflows/cpp.yml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cpp.yml b/.github/workflows/cpp.yml index 3cbd8e1..33e294a 100644 --- a/.github/workflows/cpp.yml +++ b/.github/workflows/cpp.yml @@ -19,6 +19,13 @@ jobs: steps: - uses: actions/checkout@v4 + # Set up Python 3.10 or later + - name: Set up Python 3.10 (Windows) + if: matrix.os == 'windows-latest' + uses: actions/setup-python@v2 + with: + python-version: '3.10' + # Install C++ Compiler & Build Tools - name: Set up C++ environment (Ubuntu) if: matrix.os == 'ubuntu-latest' @@ -77,5 +84,12 @@ jobs: run: make build # Install the Project with desktop shortcut - - name: Install project + - name: Install project (Mac/Windows) + if: matrix.os != 'ubuntu-latest' run: echo "y" | make install + + # Install the Project without desktop shortcut (Linux) + # This is a work around for Linux shortcut bug + - name: Install project (Linux) + if: matrix.os == 'ubuntu-latest' + run: echo "n" | make install From 880d4632dcb719fd90b08695f4d35108dd8e9674 Mon Sep 17 00:00:00 2001 From: Chris Dedman Rollet <61106361+chrisdedman@users.noreply.github.com> Date: Fri, 21 Mar 2025 20:22:21 -0700 Subject: [PATCH 7/8] [Bug] Fixing Windows CI bug --- .github/workflows/cpp.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cpp.yml b/.github/workflows/cpp.yml index 33e294a..cc6a5e6 100644 --- a/.github/workflows/cpp.yml +++ b/.github/workflows/cpp.yml @@ -86,7 +86,9 @@ jobs: # Install the Project with desktop shortcut - name: Install project (Mac/Windows) if: matrix.os != 'ubuntu-latest' - run: echo "y" | make install + run: | + cd ${{ github.workspace }} + echo "y" | make install # Install the Project without desktop shortcut (Linux) # This is a work around for Linux shortcut bug From e66e8a795e59a75f6c5c77b0e7506ce9170dc5fa Mon Sep 17 00:00:00 2001 From: Chris Dedman Rollet <61106361+chrisdedman@users.noreply.github.com> Date: Fri, 21 Mar 2025 20:31:07 -0700 Subject: [PATCH 8/8] [CI] Removed windows CI test --- .github/workflows/cpp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cpp.yml b/.github/workflows/cpp.yml index cc6a5e6..677e800 100644 --- a/.github/workflows/cpp.yml +++ b/.github/workflows/cpp.yml @@ -11,7 +11,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, windows-latest, macos-latest] + os: [ubuntu-latest, macos-latest] # TO-DO: Add back windows-latest when the project is tested on a Windows machine. fail-fast: false continue-on-error: true