Skip to content

Commit

Permalink
ci: use Arm runner for MacOS arm
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Sep 6, 2024
1 parent 2437a21 commit f28944e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 33 deletions.
38 changes: 7 additions & 31 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ jobs:
matrix:
os:
- windows-latest
- macos-13
- ubuntu-latest
# - macos-11 # arm64
- macos-13 # x86
- macos-14 # arm64
d:
- "ldc-latest"
node:
Expand Down Expand Up @@ -57,35 +57,6 @@ jobs:
with:
compiler: ${{ matrix.d }}

- name: Setup Mac Arm64
shell: bash
if: contains(matrix.os, 'macos-13')
run: |
ARCH="arm64"
echo "ARCH=$ARCH" >> $GITHUB_ENV
echo "triple=$ARCH-apple-macos" >> $GITHUB_ENV
echo "DFLAGS='-mtriple=$triple -Xcc=target -Xcc=$ARCH-apple-macos'" >> $GITHUB_ENV
echo "CPPFLAGS=$CPPFLAGS -arch $ARCH" >> $GITHUB_ENV
echo "CFLAGS=$CFLAGS -arch $ARCH" >> $GITHUB_ENV
echo "LDFLAGS=$LDFLAGS -arch $ARCH" >> $GITHUB_ENV
# Manually install ldc
# Due to https://github.com/dlang-community/setup-dlang/issues/51
curl -LJO https://github.com/ldc-developers/ldc/releases/download/v1.28.0/ldc2-1.28.0-osx-$ARCH.tar.xz
tar -xf ldc2-1.28.0-osx-$ARCH.tar.xz
rm ldc2-1.28.0-osx-$ARCH.tar.xz
LDC_PATH="~/ldc"
mkdir -p $LDC_PATH
mv ldc2-1.28.0-osx-$ARCH $LDC_PATH
# Activate ldc
echo "LIBRARY_PATH=$LDC_PATH/lib${LIBRARY_PATH:+:}${LIBRARY_PATH:-}" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=$LDC_PATH/lib${LD_LIBRARY_PATH:+:}${LD_LIBRARY_PATH:-}" >> $GITHUB_ENV
echo "PATH=$LDC_PATH/bin${PATH:+:}${PATH:-}" >> $GITHUB_ENV
echo "DMD=ldmd2" >> $GITHUB_ENV
echo "DC=ldc2" >> $GITHUB_ENV
- name: Setup Node
uses: actions/setup-node@v4
with:
Expand All @@ -104,6 +75,11 @@ jobs:
- name: Build
run: pnpm build.node

- name: Inspect Despacer
if: always()
shell: bash
run: ls ./despacer/build

- name: Test
run: pnpm test

Expand Down
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[submodule "despacer"]
path = despacer
url = https://github.com/aminya/despacer.git
branch = fix-dub
url = https://github.com/lemire/despacer.git
branch = master

0 comments on commit f28944e

Please sign in to comment.