Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
111 changes: 111 additions & 0 deletions .github/workflows/macos-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
name: macOS CI Build

on:
push:
branches:
- master
- macos-ci-workflow
pull_request:
branches:
- master
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

permissions:
contents: read
packages: write

jobs:
build:
runs-on: macos-latest
Copy link

Copilot AI Dec 18, 2025

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.

Suggested change
runs-on: macos-latest
runs-on: macos-13

Copilot uses AI. Check for mistakes.
strategy:
fail-fast: false
matrix:
compiler: [gcc, clang]
Copy link

Copilot AI Dec 18, 2025

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.

Copilot uses AI. Check for mistakes.

Copy link

Copilot AI Dec 18, 2025

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.

Suggested change

Copilot uses AI. Check for mistakes.
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive

Copy link

Copilot AI Dec 18, 2025

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.

Suggested change

Copilot uses AI. Check for mistakes.
- name: Extract Spack configuration
id: spack-config
run: |
# Source spack.sh to get SPACK_VERSION and SPACK_CHERRYPICKS
source spack.sh
echo "spack-version=${SPACK_VERSION}" >> $GITHUB_OUTPUT
echo "spack-cherrypicks<<EOF" >> $GITHUB_OUTPUT
echo "${SPACK_CHERRYPICKS}" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT

# Source spack-packages.sh to get SPACKPACKAGES_VERSION and SPACKPACKAGES_CHERRYPICKS
source spack-packages.sh
echo "spackpackages-version=${SPACKPACKAGES_VERSION}" >> $GITHUB_OUTPUT
echo "spackpackages-cherrypicks<<EOF" >> $GITHUB_OUTPUT
echo "${SPACKPACKAGES_CHERRYPICKS}" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT

# Extract buildcache URL from mirrors.yaml.in (simplified - get the version)
echo "buildcache-version=${SPACKPACKAGES_VERSION}" >> $GITHUB_OUTPUT

- name: Setup Spack
uses: spack/setup-spack@v2.1.1
with:
ref: ${{ steps.spack-config.outputs.spack-version }}
color: true
path: ${{ github.workspace }}/spack
Copy link
Contributor Author

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.


Copy link

Copilot AI Dec 18, 2025

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.

Suggested change

Copilot uses AI. Check for mistakes.
- name: Apply Spack cherry-picks
run: |
cd ${{ github.workspace }}/spack
git config user.name "GitHub Actions"
git config user.email "actions@github.com"

# Apply cherry-picks from spack.sh (match only valid git commit hashes)
echo "${{ steps.spack-config.outputs.spack-cherrypicks }}" | grep -E '^[a-f0-9]{40}$' | while read -r commit; do
echo "Cherry-picking ${commit}"
git cherry-pick "${commit}"
done

- name: Checkout and configure spack-packages
run: |
cd ${{ github.workspace }}/spack
git clone https://github.com/spack/spack-packages.git var/spack/repos/spack-packages
cd var/spack/repos/spack-packages
git checkout ${{ steps.spack-config.outputs.spackpackages-version }}
git config user.name "GitHub Actions"
git config user.email "actions@github.com"

# Apply cherry-picks from spack-packages.sh (match only valid git commit hashes)
echo "${{ steps.spack-config.outputs.spackpackages-cherrypicks }}" | grep -E '^[a-f0-9]{40}$' | while read -r commit; do
echo "Cherry-picking ${commit}"
git cherry-pick "${commit}"
done

cd ${{ github.workspace }}/spack
spack repo add var/spack/repos/spack-packages

- name: Add Spack environment
run: |
spack env create ci spack-environment/ci
spack env activate ci
Copy link

Copilot AI Dec 18, 2025

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.

Copilot uses AI. Check for mistakes.
spack -e ci compiler find
spack -e ci external find llvm
spack -e ci external find --not-buildable cmake
Comment on lines 96 to 98
Copy link
Contributor Author

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.

Copy link

Copilot AI Dec 18, 2025

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.

Suggested change
spack -e ci external find --not-buildable cmake
spack -e ci external find cmake

Copilot uses AI. Check for mistakes.

Copy link

Copilot AI Dec 18, 2025

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.

Suggested change

Copilot uses AI. Check for mistakes.
- name: Concretize
run: |
spack -e ci concretize -f

Copy link

Copilot AI Dec 18, 2025

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.

Suggested change

Copilot uses AI. Check for mistakes.
- name: Configure buildcache
run: |
spack -e ci mirror add eic oci://ghcr.io/eic/spack-${{ steps.spack-config.outputs.buildcache-version }}
spack -e ci buildcache keys --install --trust

Copy link

Copilot AI Dec 18, 2025

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.

Suggested change

Copilot uses AI. Check for mistakes.
- name: Install
run: |
spack -e ci install --no-check-signature --show-log-on-error
Loading