From dc8aff0b506fc56ddd3c7b7d0c8c764651a3e9f9 Mon Sep 17 00:00:00 2001 From: halprin Date: Sun, 15 Dec 2024 19:49:46 -0700 Subject: [PATCH] Specify shell per runner --- .github/workflows/build.yml | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2f4de2b5..e98c2cd3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 @@ -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)" @@ -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' }} @@ -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