Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@gdamore
Copy link
Owner

@gdamore gdamore commented Dec 16, 2025

Summary by CodeRabbit

  • Chores
    • Consolidated separate CI workflows into a single cross-platform "build and test" workflow.
    • Runs matrixed builds and tests across multiple OSes and D compilers, with configured exclusions.
    • Adds automated demo builds for all demo projects to CI.
    • Removes the prior standalone CI workflow configurations.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 16, 2025

Walkthrough

Removed two separate D compiler workflow files and added a single consolidated GitHub Actions workflow (build.yml) that runs a matrixed build/test across OSes and D compilers and also builds multiple demo projects.

Changes

Cohort / File(s) Change Summary
Removed DMD workflow
\.github/workflows/dmd.yml
Deleted the workflow that ran a dmd matrix (OS: ubuntu-latest, windows-latest; compiler: dmd-latest) and executed dub -q test.
Removed LDC workflow
\.github/workflows/ldc.yml
Deleted the workflow that ran an ldc matrix (OS: ubuntu-latest, macos-latest; compiler: ldc-latest) and executed dub -q test.
Added consolidated build workflow
\.github/workflows/build.yml
Added a new build and test workflow triggered on push/PR to main. Defines a matrix over OS (ubuntu-latest, windows-latest, macos-latest) and compilers (dmd-latest, ldc-latest) with exclusions, runs checkout and dlang-community/setup-dlang@v2, executes dub -q test, and iterates to dub build multiple demos (clipboard, colors, hello, mouse, styles).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Inspect matrix exclusions and confirm intended OS/compiler combinations.
  • Validate YAML syntax and action versions (actions/checkout@v6, setup-dlang@v2).
  • Verify demo build loop (paths: demos/<name>) and that failing behavior is correct across OS runners.
  • Confirm any required secrets/permissions or runner-specific adjustments (macOS vs Windows) for dub builds.

Possibly related PRs

  • chore: add windows and macos to CI #50 — Also changed CI workflows to update matrix and OS/compiler coverage; likely the predecessor or related consolidation of separate D workflows into a unified workflow.

Poem

🐰 I hopped through workflows in a whirl,

Combining jobs like a busy swirl,
Tests and demos now run as one,
Across mac, linux, windows fun,
A tiny rabbit cheers — CI done! 🥕

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: consolidating CI workflows and ensuring demos are built as part of the new unified build.yml workflow.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch ci-demos

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (2)
.github/workflows/ldc.yml (1)

34-57: Consider refactoring to reduce duplication.

These demo build steps follow the same repetitive pattern as in dmd.yml. Applying a similar matrix-based or loop-based approach would improve maintainability.

Refer to the refactoring suggestions in the dmd.yml review, which apply equally here. The verification script from dmd.yml will also confirm that all referenced demo directories exist.

.github/workflows/dmd.yml (1)

34-57: Consider refactoring repetitive demo builds for maintainability.

The demo build steps are functional but create significant duplication. All referenced demo directories (clipboard, colors, hello, mouse, styles) exist and are correctly named.

Consider using a matrix strategy to reduce duplication:

      - name: Build demos
        run: |
          for demo in clipboard colors hello mouse styles; do
            cd demos/$demo
            dub build
            cd ../..
          done

Or with GitHub Actions matrix:

  build-demos:
    needs: build
    strategy:
      matrix:
        os: [ubuntu-latest, windows-latest]
        dc: [dmd-latest]
        demo: [clipboard, colors, hello, mouse, styles]
    runs-on: ${{ matrix.os }}
    steps:
      - name: Checkout Source
        uses: actions/checkout@v6
      - name: D Compiler Installation
        uses: dlang-community/setup-dlang@v2
        with:
          compiler: ${{ matrix.dc }}
      - name: Build ${{ matrix.demo }} demo
        working-directory: demos/${{ matrix.demo }}
        run: dub build
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 15a2721 and bcce936.

📒 Files selected for processing (2)
  • .github/workflows/dmd.yml (1 hunks)
  • .github/workflows/ldc.yml (1 hunks)

@gdamore gdamore force-pushed the ci-demos branch 2 times, most recently from 3d9fb9c to 6c63f7c Compare December 16, 2025 03:33
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 5

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bcce936 and 6c63f7c.

📒 Files selected for processing (2)
  • .github/workflows/dmd.yml (1 hunks)
  • .github/workflows/ldc.yml (1 hunks)

@gdamore gdamore force-pushed the ci-demos branch 9 times, most recently from 0732ec2 to 199b643 Compare December 16, 2025 04:07
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
.github/workflows/build.yml (2)

18-22: Consider documenting the exclusion rationale.

The matrix excludes macos-latest with dmd-latest and windows-latest with ldc-latest. Adding a brief comment explaining why these combinations are excluded would help future maintainers understand the testing strategy.

         exclude:
+          # DMD not tested on macOS; LDC not tested on Windows
           - os: macos-latest
             dc: dmd-latest
           - os: windows-latest
             dc: ldc-latest

39-47: Improve error handling and directory navigation.

The demo build loop has several reliability concerns:

  • If a demo directory doesn't exist, cd fails silently and dub build runs in the wrong location
  • No verification that demo directories exist before attempting to build
  • Relative path navigation assumes exact depth

Apply this diff to add fail-fast error handling:

       - name: Build Demos
         shell: bash
         run: |
+          set -e
           for demo in clipboard colors hello mouse styles;
           do
-            cd demos/$demo
-            dub build || exit 1
-            cd ../..
+            pushd "demos/$demo"
+            dub build
+            popd
           done

The improvements:

  • set -e makes the script exit immediately on any error (including failed cd)
  • pushd/popd is more robust than cd with relative paths
  • Quotes around the path handle edge cases with spaces
  • The || exit 1 is redundant with set -e
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b7bb4d0 and ac05ac2.

📒 Files selected for processing (3)
  • .github/workflows/build.yml (1 hunks)
  • .github/workflows/dmd.yml (0 hunks)
  • .github/workflows/ldc.yml (0 hunks)
💤 Files with no reviewable changes (2)
  • .github/workflows/ldc.yml
  • .github/workflows/dmd.yml
🔇 Additional comments (4)
.github/workflows/build.yml (4)

1-7: LGTM!

The workflow name and trigger configuration are appropriate for a CI workflow that runs on pushes and pull requests to the main branch.


9-10: LGTM!

Read-only content permissions follow the principle of least privilege and are appropriate for a build and test workflow.


27-28: No changes needed. actions/checkout@v6 is the current major release and the correct version to use.

Likely an incorrect or invalid review comment.


30-37: The D compiler setup action version is confirmed. dlang-community/setup-dlang@v2 is the current major version (v2.0.0, released May 30, 2024) and is appropriate for use. The build and test configuration using dub -q test follows standard D language practices.

@gdamore gdamore merged commit acfb4b1 into main Dec 16, 2025
5 checks passed
@gdamore gdamore deleted the ci-demos branch December 16, 2025 04:17
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