-
Notifications
You must be signed in to change notification settings - Fork 5
Add macOS CI workflow #95
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
base: master
Are you sure you want to change the base?
Conversation
…s-buildcache This workflow builds the ci environment on macOS using: - spack/setup-spack@v2.1.1 for Spack installation - spack/github-actions-buildcache@v2 for build cache management - Matrix strategy for both gcc and clang compilers - Automatic buildcache push/pull for faster rebuilds
.github/workflows/macos-ci.yml
Outdated
| - name: Setup Spack | ||
| uses: spack/setup-spack@v2.1.1 | ||
| with: | ||
| ref: develop |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot Use the same spack version (and spack-packages version) that is used in the container build in this repository.
| with: | ||
| ref: develop | ||
| color: true | ||
| path: ${{ github.workspace }}/spack |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot Apply the same cherry-picks that are used in the container build in this repository.
| spack -e ci compiler find | ||
| spack -e ci external find --not-buildable cmake |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot Use the same compiler and external package finding strategy as used in the container build in this repository.
.github/workflows/macos-ci.yml
Outdated
| - name: Setup buildcache access | ||
| uses: spack/github-actions-buildcache@v2 | ||
| with: | ||
| mode: readwrite | ||
| key: macos-${{ matrix.compiler }}-ci |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot Use the same buildcache as used in the container build in this repository.
.github/workflows/macos-ci.yml
Outdated
| - name: Show environment info | ||
| if: always() | ||
| run: | | ||
| spack -e ci find -lv | ||
| spack -e ci graph --dot > ci-graph.dot | ||
|
|
||
| - name: Upload environment graph | ||
| if: always() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: ci-environment-graph-${{ matrix.compiler }} | ||
| path: ci-graph.dot |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot Ditch the environment graph.
There was a problem hiding this 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 introduces a GitHub Actions workflow to build and test the ci Spack environment on macOS platforms, expanding CI coverage beyond the existing Linux-based workflows.
Key Changes:
- Adds macOS CI workflow with GCC and Clang compiler matrix testing
- Integrates Spack buildcache management for faster rebuilds
- Includes environment graph artifact generation for inspection
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| uses: actions/checkout@v4 | ||
| with: | ||
| submodules: recursive | ||
|
|
Copilot
AI
Dec 18, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is trailing whitespace at the end of this line. This should be removed to maintain consistent formatting.
| ref: develop | ||
| color: true | ||
| path: ${{ github.workspace }}/spack | ||
|
|
Copilot
AI
Dec 18, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is trailing whitespace at the end of this line. This should be removed to maintain consistent formatting.
| spack env activate ci | ||
| spack -e ci compiler find | ||
| spack -e ci external find --not-buildable cmake | ||
|
|
Copilot
AI
Dec 18, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is trailing whitespace at the end of this line. This should be removed to maintain consistent formatting.
| with: | ||
| mode: readwrite | ||
| key: macos-${{ matrix.compiler }}-ci | ||
|
|
Copilot
AI
Dec 18, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is trailing whitespace at the end of this line. This should be removed to maintain consistent formatting.
| - name: Add Spack environment | ||
| run: | | ||
| spack env create ci spack-environment/ci | ||
| spack env activate ci |
Copilot
AI
Dec 18, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The workflow activates the Spack environment with "spack env activate ci" but doesn't persist the activation for subsequent steps. Each "run" step in GitHub Actions starts a new shell session. The activation command needs to be repeated in each step that uses the environment, or use "spack -e ci" consistently as done in later steps.
| spack env create ci spack-environment/ci | ||
| spack env activate ci | ||
| spack -e ci compiler find | ||
| spack -e ci external find --not-buildable cmake |
Copilot
AI
Dec 18, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using --not-buildable with external find for cmake means that if cmake is not found externally, the build will fail. Consider whether this is intentional or if cmake should be allowed to be built by Spack as a fallback.
| spack -e ci external find --not-buildable cmake | |
| spack -e ci external find cmake |
.github/workflows/macos-ci.yml
Outdated
| - name: Push to buildcache | ||
| if: always() | ||
| run: | | ||
| spack -e ci buildcache push --update-index --only=package --unsigned ${{ github.workspace }}/buildcache-macos |
Copilot
AI
Dec 18, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The buildcache push command references a local directory path using github.workspace, but the github-actions-buildcache action at line 54 is configured with mode: readwrite and a key, which suggests it uses GitHub's cache. The push command should reference the buildcache location configured by the action, or the workflow should be updated to ensure consistency between the buildcache setup and push operations.
| spack -e ci buildcache push --update-index --only=package --unsigned ${{ github.workspace }}/buildcache-macos | |
| spack -e ci buildcache push --update-index --only=package --unsigned |
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| compiler: [gcc, clang] |
Copilot
AI
Dec 18, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The compiler matrix variable is defined but never used in the workflow. The Spack compiler configuration relies on "spack -e ci compiler find" which will auto-detect available compilers. To properly test with different compilers as intended by the matrix strategy, the workflow should specify which compiler to use, likely through Spack's spec syntax or compiler configuration.
|
|
||
| jobs: | ||
| build: | ||
| runs-on: macos-latest |
Copilot
AI
Dec 18, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The workflow specifies "macos-latest" but doesn't consider that different macOS versions may have different default compilers and system libraries. For a more robust CI setup, consider pinning to specific macOS versions (e.g., macos-13, macos-14) or documenting which version is expected, especially since the compiler matrix suggests compiler-specific testing.
| runs-on: macos-latest | |
| runs-on: macos-13 |
| fail-fast: false | ||
| matrix: | ||
| compiler: [gcc, clang] | ||
|
|
Copilot
AI
Dec 18, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is trailing whitespace at the end of this line. This should be removed to maintain consistent formatting.
…96) * Initial plan * Align macOS CI with container build: spack versions, cherry-picks, externals, and buildcache Co-authored-by: wdconinc <4656391+wdconinc@users.noreply.github.com> * Derive spack configuration from spack.sh and spack-packages.sh at runtime Co-authored-by: wdconinc <4656391+wdconinc@users.noreply.github.com> * Fix cherry-pick loops to filter heredoc delimiters and empty lines Co-authored-by: wdconinc <4656391+wdconinc@users.noreply.github.com> * Improve cherry-pick filtering and add proper quoting for security Co-authored-by: wdconinc <4656391+wdconinc@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: wdconinc <4656391+wdconinc@users.noreply.github.com>
This PR adds a GitHub Actions workflow to build the
cienvironment on macOS.Features
spack/setup-spack@v2.1.1for Spack installationspack/github-actions-buildcache@v2for build cache managementTesting
The workflow will run automatically on this PR to validate the macOS build.