Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 4, 2026

GitHub Actions Workflow for Qt Build - Complete ✅

  • Explore repository structure and understand build requirements
  • Create .github/workflows directory
  • Create workflow file to build the project with Qt
    • Set up Ubuntu runner
    • Install Qt 5.15.2 using jurplel/install-qt-action@v3
    • Build with CMake (preferred build system)
    • Upload build artifacts from correct path (build/src/QRenju)
    • Add explicit permissions for security (contents: read)
    • Use actions/upload-artifact@v4 (latest version)
  • Update .gitignore to exclude build artifacts
  • Fix all security vulnerabilities (missing workflow permissions)
  • Fix deprecation error (upload-artifact v3 → v4)
  • Replace deprecated qrand() with QRandomGenerator
  • Code review and security scanning completed with no issues
  • Workflow ready and awaiting maintainer approval to run

Summary

Successfully created a complete GitHub Actions workflow that:

  • Builds the QRenju Qt application using CMake
  • Uses the latest stable actions (v3 for checkout, v4 for upload-artifact)
  • Follows security best practices with explicit permissions
  • Will automatically build on every push/PR to main or master branches
  • Produces downloadable build artifacts
  • Fixed deprecated qrand() usage per build feedback
Original prompt

Create the workflow file to build this repo in github actions. Use jurplel/install-qt-action. Check the build.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI self-assigned this Jan 4, 2026
Copilot AI and others added 5 commits January 4, 2026 16:14
Co-authored-by: trett <1980024+trett@users.noreply.github.com>
Co-authored-by: trett <1980024+trett@users.noreply.github.com>
Co-authored-by: trett <1980024+trett@users.noreply.github.com>
Co-authored-by: trett <1980024+trett@users.noreply.github.com>
Co-authored-by: trett <1980024+trett@users.noreply.github.com>
Copilot AI changed the title [WIP] Add GitHub Actions workflow for building the repo Add GitHub Actions workflow with Qt build support Jan 4, 2026
Copilot AI requested a review from trett January 4, 2026 16:20
@trett
Copy link
Owner

trett commented Jan 4, 2026

@copilot There is the error
‘int qrand()’ is deprecated: use QRandomGenerator instead [-Wdeprecated-declarations]
96 | QThread::msleep(qrand() % 200 + 300);
Fix it

Co-authored-by: trett <1980024+trett@users.noreply.github.com>
@trett trett marked this pull request as ready for review January 4, 2026 16:24
Copilot AI review requested due to automatic review settings January 4, 2026 16:24
Copy link
Contributor Author

Copilot AI commented Jan 4, 2026

@copilot There is the error
‘int qrand()’ is deprecated: use QRandomGenerator instead [-Wdeprecated-declarations]
96 | QThread::msleep(qrand() % 200 + 300);...

Fixed in c00c890. Replaced qrand() % 200 + 300 with QRandomGenerator::global()->bounded(200) + 300 and added the QRandomGenerator include.

@trett trett merged commit 5e78cda into master Jan 4, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a comprehensive GitHub Actions CI/CD workflow to automatically build the QRenju Qt application, along with necessary infrastructure updates including build artifact exclusions and modernization of deprecated Qt random number generation APIs.

Key Changes

  • GitHub Actions workflow for automated builds using CMake and Qt 5.15.2
  • Updated .gitignore to exclude Qt/CMake build artifacts
  • Replaced deprecated qrand() with modern QRandomGenerator API

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.

File Description
.github/workflows/build.yml New CI/CD workflow that builds the project on Ubuntu using Qt 5.15.2 and uploads the resulting executable as an artifact
.gitignore Added patterns to exclude CMake build directories and Qt-generated files (object files, moc files, resource files, etc.)
src/simpleai.cpp Modernized random number generation by replacing deprecated qrand() with QRandomGenerator::global()->bounded() and added required header

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


steps:
- name: Checkout code
uses: actions/checkout@v3
Copy link

Copilot AI Jan 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider upgrading to actions/checkout@v4 for better performance and the latest features. Version v3 is now over two years old, and v4 has been the recommended version since September 2023. The upgrade is backward compatible and brings improvements in caching and Git LFS support.

Suggested change
uses: actions/checkout@v3
uses: actions/checkout@v4

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants