Skip to content

Commit

Permalink
ARM Mac CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Apprentice-Alchemist committed Feb 4, 2024
1 parent c55da75 commit af39846
Show file tree
Hide file tree
Showing 3 changed files with 122 additions and 2 deletions.
101 changes: 100 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,106 @@ jobs:
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: macBinaries
name: ${{ env.PLATFORM }}Binaries
path: out


mac-arm-build:
runs-on: macos-14
env:
PLATFORM: mac-arm
OPAMYES: 1
MACOSX_DEPLOYMENT_TARGET: 11
steps:
- uses: actions/checkout@main
with:
submodules: recursive

- name: Cache opam
id: cache-opam
uses: actions/cache@v3.0.11
with:
path: ~/.opam/
key: ${{ runner.os }}-${{ hashFiles('./haxe.opam', './libs/') }}

- name: Install Neko from S3
run: |
set -ex
curl -sSL https://build.haxe.org/builds/neko/$PLATFORM/neko_latest.tar.gz -o $RUNNER_TEMP/neko_latest.tar.gz
tar -xf $RUNNER_TEMP/neko_latest.tar.gz -C $RUNNER_TEMP
NEKOPATH=`echo $RUNNER_TEMP/neko-*-*`
sudo mkdir -p /usr/local/bin
sudo mkdir -p /usr/local/lib/neko
sudo ln -s $NEKOPATH/{neko,nekoc,nekoml,nekotools} /usr/local/bin/
sudo ln -s $NEKOPATH/libneko.* /usr/local/lib/
sudo ln -s $NEKOPATH/*.ndll /usr/local/lib/neko/
echo "NEKOPATH=$NEKOPATH" >> $GITHUB_ENV
- name: Print Neko version
run: neko -version 2>&1

- name: Install dependencies
env:
# For compatibility with macOS 10.13
ZLIB_VERSION: 1.3.1
MBEDTLS_VERSION: 2.28.5
PCRE2_VERSION: 10.42
run: |
set -ex
brew update
brew bundle --file=tests/Brewfile --no-upgrade
cpanm IPC::System::Simple
cpanm String::ShellQuote
curl -L https://github.com/madler/zlib/releases/download/v$ZLIB_VERSION/zlib-$ZLIB_VERSION.tar.gz | tar xz
cd zlib-$ZLIB_VERSION
./configure
make && make install
cd ..
curl -L https://github.com/ARMmbed/mbedtls/archive/v$MBEDTLS_VERSION.tar.gz | tar xz
cd mbedtls-$MBEDTLS_VERSION
make && make install
cd ..
curl -L https://github.com/PCRE2Project/pcre2/releases/download/pcre2-$PCRE2_VERSION/pcre2-$PCRE2_VERSION.tar.gz | tar xz
cd pcre2-$PCRE2_VERSION
./configure --enable-unicode --enable-pcre2-8 --enable-pcre2-16 --enable-pcre2-32 --enable-unicode-properties --enable-pcre2grep-libz --enable-pcre2grep-libbz2 --enable-jit
make && make install
cd ..
- name: Install OCaml libraries
if: steps.cache-opam.outputs.cache-hit != 'true'
run: |
set -ex
opam init # --disable-sandboxing
opam update
opam switch create 4.08.1
eval $(opam env)
opam env
opam pin add ctypes 0.17.1 --yes
opam pin add haxe . --no-action
opam install haxe --deps-only --assume-depexts
opam list
ocamlopt -v
- name: Set ADD_REVISION=1 for non-release
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
run: echo "ADD_REVISION=1" >> $GITHUB_ENV

- name: Build Haxe
run: |
set -ex
eval $(opam env)
opam config exec -- make -s -j`sysctl -n hw.ncpu` STATICLINK=1 "LIB_PARAMS=/usr/local/lib/libz.a /usr/local/lib/libpcre2-8.a /usr/local/lib/libmbedtls.a /usr/local/lib/libmbedcrypto.a /usr/local/lib/libmbedx509.a -cclib '-framework Security -framework CoreFoundation'" haxe
opam config exec -- make -s haxelib
make -s package_unix package_installer_mac
ls -l out
otool -L ./haxe
otool -L ./haxelib
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: ${{ env.PLATFORM }}Binaries
path: out


Expand Down
2 changes: 1 addition & 1 deletion extra/github-actions/build-mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,5 @@
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: macBinaries
name: ${{ env.PLATFORM }}Binaries
path: out
21 changes: 21 additions & 0 deletions extra/github-actions/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,27 @@ jobs:
@import install-neko-unix.yml
@import build-mac.yml

mac-arm-build:
runs-on: macos-14
env:
PLATFORM: mac-arm
OPAMYES: 1
MACOSX_DEPLOYMENT_TARGET: 11
steps:
- uses: actions/checkout@main
with:
submodules: recursive

- name: Cache opam
id: cache-opam
uses: actions/cache@v3.0.11
with:
path: ~/.opam/
key: ${{ runner.os }}-${{ hashFiles('./haxe.opam', './libs/') }}

@import install-neko-unix.yml
@import build-mac.yml

windows64-test:
needs: windows64-build
runs-on: windows-latest
Expand Down

0 comments on commit af39846

Please sign in to comment.