Skip to content

[CI] Inital CI implementation #21

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

Merged
merged 8 commits into from
Mar 22, 2025
Merged
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
97 changes: 97 additions & 0 deletions .github/workflows/cpp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: C++ CI

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
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

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'
run: |
sudo apt-get update
sudo apt-get install -y g++ make cmake
g++ --version
cmake --version
make --version

- name: Set up C++ environment (macOS)
if: matrix.os == 'macos-latest'
run: |
brew install 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
echo 'export PATH="/usr/lib/qt6/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc

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

# Build the Project
- name: Build project
run: make build

# Install the Project with desktop shortcut
- name: Install project (Mac/Windows)
if: matrix.os != 'ubuntu-latest'
run: |
cd ${{ github.workspace }}
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
Loading