Update c-cpp.yml #13
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Test Qt Project | |
on: [push, pull_request] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y build-essential libgl1-mesa-dev | |
- name: Setup Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.12' | |
- name: Install yaqti | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install yaqti | |
- name: Clean up existing Qt directory | |
run: | | |
if [ -d "qt" ]; then | |
echo "Removing existing Qt directory" | |
rm -rf qt | |
fi | |
- name: Install Qt5/Qt6 (yaqti) | |
run: | | |
python -m yaqti install --version 5.15.2 --os linux --platform desktop --set-envs --install-deps | |
- name: Find and set Qt path | |
run: | | |
# Find where qmake is installed | |
QT_DIR=$(find ~/ -type d -name "qt" -print -quit) | |
if [ -z "$QT_DIR" ]; then | |
echo "Qt installation directory not found." | |
exit 1 | |
fi | |
echo "Qt installation directory: $QT_DIR" | |
export PATH=$QT_DIR/bin:$PATH | |
echo "PATH updated." | |
- name: Verify Qt installation | |
run: | | |
qmake --version | |
echo "Qt installation verified." | |
- name: Build with qmake and make | |
run: | | |
qmake | |
make | |
- name: Run tests | |
run: | | |
echo "No tests to run for this example" |