From 1930612029c5496939d7b20bcbb57bc2d95d631a Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Thu, 30 Dec 2021 07:20:35 -0600 Subject: [PATCH] ci: build for M1 Mac --- .github/workflows/CI.yml | 49 ++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 25 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 1310a16..0f0a076 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -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: @@ -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 }} @@ -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