Skip to content

Commit

Permalink
Specify shell per runner
Browse files Browse the repository at this point in the history
  • Loading branch information
halprin committed Dec 16, 2024
1 parent c7f4814 commit dc8aff0
Showing 1 changed file with 19 additions and 14 deletions.
33 changes: 19 additions & 14 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,38 +24,44 @@ jobs:
cc: cl
cxx: cl
name: Windows-x64
shell: ''
- runner: macos-14
preset: mac
cc: cc
cxx: c++
name: macOS-Intel
shell: arch -x86_64 /bin/bash -e {0}
- runner: macos-14
preset: mac
cc: cc
cxx: c++
name: macOS-ARM
shell: ''
- runner: ubuntu-latest
preset: linux
cc: gcc
cxx: g++
name: Linux-x64
shell: ''
- runner: ubuntu-latest
preset: linux
cc: clang
cxx: clang++
name: Linux-x64-clang
shell: ''
- runner: ubuntu-latest
preset: linux-cross-arm64
cc: gcc
cxx: g++++
name: Linux-cross-arm64
shell: ''
build_type:
- Debug
- Release

runs-on: ${{ matrix.os.runner }}
env:
MACOS_ARCH_COMMAND: '' # default to nothing
# env:
# MACOS_ARCH_COMMAND: '' # default to nothing

steps:
- uses: actions/checkout@v4
Expand All @@ -66,11 +72,11 @@ jobs:
if: ${{ matrix.os.name == 'macOS-Intel' }}
run: |
/usr/sbin/softwareupdate --install-rosetta --agree-to-license
echo "MACOS_ARCH_COMMAND=arch -x86_64" >> $GITHUB_ENV
# echo "MACOS_ARCH_COMMAND=arch -x86_64" >> $GITHUB_ENV

- name: Install Intel version of Brew
if: ${{ matrix.os.name == 'macOS-Intel' }}
shell: arch -x86_64 /bin/bash -e {0}
shell: ${{ matrix.os.shell }}
run: |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Expand All @@ -80,16 +86,11 @@ jobs:

- name: Install macOS Intel dependencies
if: ${{ matrix.os.preset == 'mac' && matrix.os.name == 'macOS-Intel' }}
shell: arch -x86_64 /bin/bash -e {0}
shell: ${{ matrix.os.shell }}
run: |
which brew
echo $PATH
eval "$(/usr/local/bin/brew shellenv)"
which brew
echo $PATH
echo "PATH=$PATH" >> $GITHUB_ENV # modify $PATH for future steps so the Intel Brew and its installs are enshrined as the default
brew bundle install
file /usr/local/bin/cmake
- name: Install Linux dependencies
if: ${{ matrix.os.runner == 'ubuntu-latest' }}
Expand Down Expand Up @@ -126,21 +127,25 @@ jobs:
- name: Configure CMake
if: ${{ matrix.os.preset != 'linux-cross-arm64' }}
shell: ${{ matrix.os.shell }}
env:
CC: ${{ matrix.os.cc }}
CXX: ${{ matrix.os.cxx }}
run: $MACOS_ARCH_COMMAND cmake --preset ${{ matrix.os.preset }} -DBUILD_TESTING=ON -DENABLE_LOGGER=ON -DFORCE_PORTABLE_INSTALL=ON -DBUILD_EDITOR=ON -DUSE_EXTERNAL_PLOG=ON
run: cmake --preset ${{ matrix.os.preset }} -DBUILD_TESTING=ON -DENABLE_LOGGER=ON -DFORCE_PORTABLE_INSTALL=ON -DBUILD_EDITOR=ON -DUSE_EXTERNAL_PLOG=ON

- name: Build ${{ matrix.build_type }}
run: $MACOS_ARCH_COMMAND cmake --build --preset ${{ matrix.os.preset }} --config ${{ matrix.build_type }} --verbose
shell: ${{ matrix.os.shell }}
run: cmake --build --preset ${{ matrix.os.preset }} --config ${{ matrix.build_type }} --verbose

- name: Run ${{ matrix.build_type }} Unittests
if: ${{ matrix.os.preset != 'linux-cross-arm64' }}
run: $MACOS_ARCH_COMMAND ctest --preset ${{ matrix.os.preset }} -C ${{ matrix.build_type }}
shell: ${{ matrix.os.shell }}
run: ctest --preset ${{ matrix.os.preset }} -C ${{ matrix.build_type }}

- name: Local install
shell: ${{ matrix.os.shell }}
# There no cmake install presets so install in traditional way
run: $MACOS_ARCH_COMMAND cmake --install builds/${{ matrix.os.preset }}/ --config ${{ matrix.build_type }}
run: cmake --install builds/${{ matrix.os.preset }}/ --config ${{ matrix.build_type }}

- name: Upload Artifacts
uses: actions/upload-artifact@v4
Expand Down

0 comments on commit dc8aff0

Please sign in to comment.