Skip to content

Testing for Apple Silicon CI #635

Testing for Apple Silicon CI

Testing for Apple Silicon CI #635

Workflow file for this run

name: MacVim GitHub CI
on:
push:
pull_request:
# Cancels all previous workflow runs for pull requests that have not completed.
concurrency:
# The concurrency group contains the workflow name and the branch name for
# pull requests or the commit hash for any other events.
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true
env:
MACOSX_DEPLOYMENT_TARGET: '10.13'
MACOSX_DEPLOYMENT_TARGET_LEGACY: '10.9'
MACVIM_ARCHS: "x86_64 arm64" # Universal app for Intel/Apple Silicon
MACVIM_ARCHS_LEGACY: "x86_64" # Legacy builds only need to build x86-64 because Apple Silicon can't run on these old OSes
CC: clang
MAKE_BUILD_ARGS: LINK_AS_NEEDED=yes # In macOS we never over-specify link dependencies and we already check against external deps in smoketest. With LTO, linking takes a while, so we want to avoid using link.sh.
VERSIONER_PERL_VERSION: '5.30' # macOS default Perl installation uses this to determine which one to use
vi_cv_path_python: /Library/Frameworks/Python.framework/Versions/2.7/bin/python
vi_cv_path_python3: "%s/bin/python3"
vi_cv_path_plain_lua: "%s/bin/lua"
vi_cv_path_ruby: "%s/opt/ruby/bin/ruby"
vi_cv_dll_name_perl: /System/Library/Perl/%s/darwin-thread-multi-2level/CORE/libperl.dylib
vi_cv_dll_name_python: /Library/Frameworks/Python.framework/Versions/2.7/Python
vi_cv_dll_name_python3: /usr/local/Frameworks/Python.framework/Versions/Current/Python
vi_cv_dll_name_python3_arm64: /opt/homebrew/Frameworks/Python.framework/Versions/Current/Python
vi_cv_dll_name_ruby: /usr/local/opt/ruby/lib/libruby.dylib
vi_cv_dll_name_ruby_arm64: /opt/homebrew/opt/ruby/lib/libruby.dylib
vi_cv_dll_name_lua: /usr/local/lib/liblua.dylib
vi_cv_dll_name_lua_arm64: /opt/homebrew/lib/liblua.dylib
MACVIM_APP: src/MacVim/build/Release/MacVim.app
VIM_BIN: src/MacVim/build/Release/MacVim.app/Contents/MacOS/Vim
MACVIM_BIN: src/MacVim/build/Release/MacVim.app/Contents/MacOS/MacVim
TERM: xterm
BASH_SILENCE_DEPRECATION_WARNING: 1
jobs:
# Builds and test MacVim
build-and-test:
# Test on macOS 11.x / 12.x, and also older versions of Xcode for compatibility testing.
strategy:
fail-fast: false
matrix:
include:
# Oldest version of Xcode supported on GitHub Action to test source code backwards compatibility
- os: macos-11
xcode: '11.7'
extra: [vimtags, check-xcodeproj-compat]
# Older version of Xcode, and used to publish legacy builds (for macOS 10.9 - 10.12)
- os: macos-12
xcode: '14.0' # last version of Xcode that uses the macOS 12 SDK, which still supports deploying to macOS 10.9
publish: true
legacy: true
publish_postfix: '_10.9'
# Most up to date OS and Xcode. Used to publish release for the main build.
- os: macos-13
xcode: '15.1'
publish: true
optimized: true
# TEST TEST TEST
- os: macos-14
xcode: '15.2'
publish: true
optimized: true
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up legacy build
if: matrix.legacy
run: |
# Set the correct build env vars to target the correct architectures and min OS targets.
echo "MACOSX_DEPLOYMENT_TARGET=$MACOSX_DEPLOYMENT_TARGET_LEGACY" >> $GITHUB_ENV
echo "MACVIM_ARCHS=$MACVIM_ARCHS_LEGACY" >> $GITHUB_ENV
# Use Sparkle 1 because Sparkle 2 requires newer OS version than our legacy build.
# Later, we pass the --enable-sparkle_1 flag to configure to set the corresponding ifdef.
ln -fhs Sparkle_1.framework src/MacVim/Sparkle.framework
# Sparkle shows a dialog asking if the user wants to check for updates on 2nd launch of
# MacVim. On Sparkle 1 this is annoyingly a modal dialog box and interferes with tests.
# Just disable it by pre-setting to not check for updates.
defaults write org.vim.MacVim SUEnableAutomaticChecks 0
- name: Set up Xcode
if: matrix.xcode != ''
run: |
sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer
xcode-select -p
xcodebuild -version
# Set up, install, and cache gettext library for localization.
#
- name: Set up gettext
if: matrix.publish
uses: ./.github/actions/universal-package
with:
formula: gettext
contents: lib/libintl.a,lib/libintl.dylib
# Set up, install, and cache libsodium library for encryption.
- name: Set up libsodium
if: matrix.publish
uses: ./.github/actions/universal-package
with:
formula: libsodium
contents: lib/libsodium.a,lib/libsodium.dylib