Skip to content

Conversation

@lacostenycoder
Copy link
Owner

@lacostenycoder lacostenycoder commented Aug 29, 2025

Summary by Sourcery

Add a comprehensive CMake-based GitHub Actions workflow for cross-platform builds, tests, packaging, and artifact publishing, and remove the obsolete master-build.yml.

Enhancements:

  • Introduce a unified CI workflow for Windows, Linux, and macOS builds using CMake
  • Install platform-specific dependencies, configure and build in Release mode, and run tests when available
  • Package build outputs into archives, upload artifacts, and generate development release notes
  • Add a release job to create prereleases on pushes to main/master with automatic release notes

Chores:

  • Remove deprecated .github/workflows/master-build.yml

@sourcery-ai
Copy link

sourcery-ai bot commented Aug 29, 2025

Reviewer's Guide

Replaces the legacy master-build workflow with a unified GitHub Actions pipeline (build.yml) featuring multi-platform CMake builds, OS-specific dependency installation, testing, packaging, artifact uploads, and conditional automated prerelease creation.

File-Level Changes

Change Details Files
Introduce CMake-based multi-platform build pipeline
  • Defined a build job with matrix strategy for Windows, Linux, and macOS
  • Added checkout with recursive submodules and CMake setup
  • Installed OS-specific dependencies and set up MSVC on Windows
  • Configured CMake, built in Release mode, and ran tests with output on failure
  • Packaged executables, presets, and docs into zip/tar archives and uploaded artifacts
.github/workflows/build.yml
Add conditional development release job
  • Triggered on pushes to main/master only
  • Downloaded and listed build artifacts
  • Generated release-notes.md with commit info, timestamp, workflow link, and platform list
  • Published a prerelease via softprops/action-gh-release with attached archives
.github/workflows/build.yml
Remove deprecated master-build workflow
  • Deleted legacy master-build.yml to avoid duplication
.github/workflows/master-build.yml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes - here's some feedback:

Blocking issues:

  • An action sourced from a third-party repository on GitHub is not pinned to a full length commit SHA. Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps mitigate the risk of a bad actor adding a backdoor to the action's repository, as they would need to generate a SHA-1 collision for a valid Git object payload. (link)
  • An action sourced from a third-party repository on GitHub is not pinned to a full length commit SHA. Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps mitigate the risk of a bad actor adding a backdoor to the action's repository, as they would need to generate a SHA-1 collision for a valid Git object payload. (link)
  • An action sourced from a third-party repository on GitHub is not pinned to a full length commit SHA. Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps mitigate the risk of a bad actor adding a backdoor to the action's repository, as they would need to generate a SHA-1 collision for a valid Git object payload. (link)

General comments:

  • The release notes use placeholder "?? Windows x64" etc—consider programmatically listing actual platforms or replacing those placeholders to keep the notes accurate.
  • The test step is marked continue-on-error, so failing tests won’t break the workflow—remove that flag if you want test failures to fail the build.
  • Consider adding caching (using actions/cache) for CMake state and package installs (apt/homebrew) to significantly speed up CI builds.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The release notes use placeholder "?? Windows x64" etc—consider programmatically listing actual platforms or replacing those placeholders to keep the notes accurate.
- The test step is marked continue-on-error, so failing tests won’t break the workflow—remove that flag if you want test failures to fail the build.
- Consider adding caching (using actions/cache) for CMake state and package installs (apt/homebrew) to significantly speed up CI builds.

## Individual Comments

### Comment 1
<location> `.github/workflows/build.yml:92` </location>
<code_context>
+    - name: Build
+      shell: bash
+      run: |
+        cmake --build build --config Release --parallel $(nproc 2>/dev/null || echo 4)
+
+    - name: List Build Output
</code_context>

<issue_to_address>
The use of $(nproc 2>/dev/null || echo 4) for parallel builds may not work on macOS or Windows runners.

Since nproc is not available on macOS and this command fails on Windows, please use a more portable method for setting parallelism, such as a fixed value or leveraging GitHub Actions environment variables.
</issue_to_address>

### Comment 2
<location> `.github/workflows/build.yml:141` </location>
<code_context>
+        # Create archive
+        cd ..
+        if [ "${{ runner.os }}" == "Windows" ]; then
+          7z a audio-level-fixer-${{ matrix.config.artifact_name }}.zip audio-level-fixer-${{ matrix.config.artifact_name }}/*
+        else
+          tar -czf audio-level-fixer-${{ matrix.config.artifact_name }}.tar.gz audio-level-fixer-${{ matrix.config.artifact_name }}/
</code_context>

<issue_to_address>
The workflow assumes 7z is available on Windows runners for zipping artifacts.

Please add a step to install 7-Zip on Windows runners, or switch to a built-in zip utility to ensure compatibility.
</issue_to_address>

### Comment 3
<location> `.github/workflows/build.yml:112` </location>
<code_context>
+        else
+          echo "No tests found - skipping"
+        fi
+      continue-on-error: true
+
+    - name: Package Artifacts
</code_context>

<issue_to_address>
Tests are allowed to fail without failing the workflow.

Consider removing 'continue-on-error' or making it conditional if test failures should prevent releases.
</issue_to_address>

## Security Issues

### Issue 1
<location> `.github/workflows/build.yml:45` </location>

<issue_to_address>
**security (yaml.github-actions.security.third-party-action-not-pinned-to-commit-sha):** An action sourced from a third-party repository on GitHub is not pinned to a full length commit SHA. Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps mitigate the risk of a bad actor adding a backdoor to the action's repository, as they would need to generate a SHA-1 collision for a valid Git object payload.

*Source: opengrep*
</issue_to_address>

### Issue 2
<location> `.github/workflows/build.yml:67` </location>

<issue_to_address>
**security (yaml.github-actions.security.third-party-action-not-pinned-to-commit-sha):** An action sourced from a third-party repository on GitHub is not pinned to a full length commit SHA. Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps mitigate the risk of a bad actor adding a backdoor to the action's repository, as they would need to generate a SHA-1 collision for a valid Git object payload.

*Source: opengrep*
</issue_to_address>

### Issue 3
<location> `.github/workflows/build.yml:187` </location>

<issue_to_address>
**security (yaml.github-actions.security.third-party-action-not-pinned-to-commit-sha):** An action sourced from a third-party repository on GitHub is not pinned to a full length commit SHA. Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps mitigate the risk of a bad actor adding a backdoor to the action's repository, as they would need to generate a SHA-1 collision for a valid Git object payload.

*Source: opengrep*
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

- name: Build
shell: bash
run: |
cmake --build build --config Release --parallel $(nproc 2>/dev/null || echo 4)
Copy link

Choose a reason for hiding this comment

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

issue (performance): The use of $(nproc 2>/dev/null || echo 4) for parallel builds may not work on macOS or Windows runners.

Since nproc is not available on macOS and this command fails on Windows, please use a more portable method for setting parallelism, such as a fixed value or leveraging GitHub Actions environment variables.

# Create archive
cd ..
if [ "${{ runner.os }}" == "Windows" ]; then
7z a audio-level-fixer-${{ matrix.config.artifact_name }}.zip audio-level-fixer-${{ matrix.config.artifact_name }}/*
Copy link

Choose a reason for hiding this comment

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

issue (bug_risk): The workflow assumes 7z is available on Windows runners for zipping artifacts.

Please add a step to install 7-Zip on Windows runners, or switch to a built-in zip utility to ensure compatibility.

else
echo "No tests found - skipping"
fi
continue-on-error: true
Copy link

Choose a reason for hiding this comment

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

question (testing): Tests are allowed to fail without failing the workflow.

Consider removing 'continue-on-error' or making it conditional if test failures should prevent releases.

submodules: recursive

- name: Setup CMake
uses: lukka/get-cmake@latest
Copy link

Choose a reason for hiding this comment

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

security (yaml.github-actions.security.third-party-action-not-pinned-to-commit-sha): An action sourced from a third-party repository on GitHub is not pinned to a full length commit SHA. Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps mitigate the risk of a bad actor adding a backdoor to the action's repository, as they would need to generate a SHA-1 collision for a valid Git object payload.

Source: opengrep


- name: Setup MSVC (Windows)
if: runner.os == 'Windows'
uses: microsoft/setup-msbuild@v2
Copy link

Choose a reason for hiding this comment

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

security (yaml.github-actions.security.third-party-action-not-pinned-to-commit-sha): An action sourced from a third-party repository on GitHub is not pinned to a full length commit SHA. Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps mitigate the risk of a bad actor adding a backdoor to the action's repository, as they would need to generate a SHA-1 collision for a valid Git object payload.

Source: opengrep

echo "> **Note:** This is an automated development build. The project is under active development." >> release-notes.md

- name: Create Development Release
uses: softprops/action-gh-release@v1
Copy link

Choose a reason for hiding this comment

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

security (yaml.github-actions.security.third-party-action-not-pinned-to-commit-sha): An action sourced from a third-party repository on GitHub is not pinned to a full length commit SHA. Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps mitigate the risk of a bad actor adding a backdoor to the action's repository, as they would need to generate a SHA-1 collision for a valid Git object payload.

Source: opengrep

@lacostenycoder lacostenycoder merged commit 1d81181 into master Aug 29, 2025
1 of 4 checks passed
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