Skip to content

Commit

Permalink
ci: build for M1 Mac
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Dec 30, 2021
1 parent eedb7d9 commit 3e5c47c
Showing 1 changed file with 24 additions and 25 deletions.
49 changes: 24 additions & 25 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,19 @@ jobs:
- windows-latest
- macos-latest
- ubuntu-latest
- macos-11 # arm64
d:
- "ldc-1.27.1"
- "ldc-1.28.0"
node:
- 16
pnpm:
- 6
clang:
- 12.0.0
compiler:
- llvm-12.0.0
cmake:
- 3.20.2
- "3.22.1"
ninja:
- 1.10.2
CC:
- clang
CXX:
- clang++
env:
CC: ${{ matrix.CC }}
CXX: ${{ matrix.CXX }}
- "1.10.2"
steps:
- uses: actions/checkout@v2
with:
Expand All @@ -49,23 +43,16 @@ jobs:
~/.pnpm-store
D:\.pnpm-store
./.dub
./llvm
C:/Program Files/LLVM
key: "cache-OS:${{ matrix.os }}-D:${{ matrix.d }}-Clang:${{ matrix.clang }}-dub:${{ hashFiles('./dub.selections.json')}}-pnpm:${{ hashFiles('./pnpm-lock.yaml') }}"
~/llvm
key: "cache-OS:${{ matrix.os }}-D:${{ matrix.d }}-CXX:${{ matrix.compiler }}-dub:${{ hashFiles('./dub.selections.json')}}-pnpm:${{ hashFiles('./pnpm-lock.yaml') }}"
restore-keys: |
"cache-OS:${{ matrix.os }}-D:${{ matrix.d }}-Clang:${{ matrix.clang }}"
"cache-OS:${{ matrix.os }}-D:${{ matrix.d }}-CXX:${{ matrix.compiler }}"
# Setup compilers and tools

- name: Setup LLVM
uses: KyleMayes/install-llvm-action@v1
with:
version: ${{ matrix.clang }}
cached: ${{ steps.cache.outputs.cache-hit }}

- name: Setup Cmake and Ninja
uses: aminya/install-cmake@new-versions-and-arch
- name: Setup Cpp
uses: aminya/setup-cpp@v1
with:
compiler: ${{ matrix.compiler }}
cmake: ${{ matrix.cmake }}
ninja: ${{ matrix.ninja }}

Expand All @@ -83,6 +70,18 @@ jobs:
with:
compiler: ${{ matrix.d }}

- name: Setup Mac Arm64
shell: bash
if: contains(matrix.os, 'macos-11')
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
# Build and Test

- name: Install dependencies
Expand Down

0 comments on commit 3e5c47c

Please sign in to comment.