Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: enable M1 runners for CI job #1127

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/container-linux-static/stack-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
extra-include-dirs:
- /usr/include
extra-lib-dirs:
- /lib
- /usr/lib
44 changes: 38 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:

env:
# Tag for cache invalidation
CACHE_VERSION: v6
CACHE_VERSION: v1

jobs:
build:
Expand All @@ -25,6 +25,8 @@ jobs:
container: "{\"image\": \"elopeztob/alpine-haskell-stack-echidna:ghc-9.4.7\", \"options\": \"--user 1001\"}"
- os: macos-latest
shell: bash
- os: macos-latest-xlarge
shell: bash
- os: windows-latest
shell: msys2 {0}

Expand All @@ -35,7 +37,7 @@ jobs:
steps:
- name: Get Packages (macOS)
if: runner.os == 'macOS'
run: brew install automake
run: brew install autoconf automake libtool

- name: Get Packages (Windows)
uses: msys2/setup-msys2@v2
Expand All @@ -61,7 +63,7 @@ jobs:
openssl:p

- name: Install Stack
uses: haskell-actions/setup@v2
uses: haskell-actions/setup@v2.6.0
id: stack
if: matrix.container == ''
with:
Expand All @@ -76,10 +78,12 @@ jobs:
{ echo "extra-include-dirs:";
echo "- $HOME/.local/include";
echo "$EXTRA_INCLUDE_WIN";
echo "$EXTRA_INCLUDE_MAC_AARCH64";
echo;
echo "extra-lib-dirs:";
echo "- $HOME/.local/lib";
echo "$EXTRA_LIB_WIN";
echo "$EXTRA_LIB_MAC_AARCH64";
echo;
echo "ghc-options:";
echo -n ' "$locals": -Werror'
Expand All @@ -93,6 +97,8 @@ jobs:
EXTRA_INCLUDE_WIN: ${{ (runner.os == 'Windows' && '- C:/msys64/clang64/include') || '' }}
EXTRA_LIB_WIN: ${{ (runner.os == 'Windows' && '- C:/msys64/clang64/lib') || '' }}
REPLACE_LINKER_WIN: ${{ (runner.os == 'Windows' && 'true') || 'false' }}
EXTRA_INCLUDE_MAC_AARCH64: ${{ (runner.os == 'macOS' && runner.arch == 'ARM64' && '- /opt/homebrew/include') || '' }}
EXTRA_LIB_MAC_AARCH64: ${{ (runner.os == 'macOS' && runner.arch == 'ARM64' && '- /opt/homebrew/lib') || '' }}
SKIP_MSYS: ${{ (runner.os == 'Windows' && 'true') || 'false' }}

- name: Configure Haskell paths (Windows)
Expand All @@ -114,7 +120,7 @@ jobs:
path: |
~/.local
C:\msys64\home\runneradmin\.local
key: ${{ runner.os }}-local-${{ env.CACHE_VERSION }}-${{ hashFiles('.github/scripts/install-*') }}
key: ${{ runner.os }}-${{ runner.arch }}-local-${{ env.CACHE_VERSION }}-${{ hashFiles('.github/scripts/install-*') }}

- name: Cache Stack & Cabal
uses: actions/cache@v3
Expand All @@ -126,7 +132,7 @@ jobs:
!${{ steps.stack.outputs.stack-root || '~/.stack' }}/pantry/hackage/*.tar
!${{ steps.stack.outputs.stack-root || '~/.stack' }}/pantry/hackage/*.tar.gz
!${{ steps.stack.outputs.stack-root || '~/.stack' }}/config.yaml
key: ${{ runner.os }}-stack-${{ env.CACHE_VERSION }}-${{ hashFiles('package.yaml', 'stack.yaml') }}
key: ${{ runner.os }}-${{ runner.arch }}-stack-${{ env.CACHE_VERSION }}-${{ hashFiles('package.yaml', 'stack.yaml') }}

- name: Build Libraries
run: |
Expand Down Expand Up @@ -157,10 +163,36 @@ jobs:
if: runner.os == 'Windows'
run: GZIP=-9 tar -czf echidna.tar.gz -C $APPDATA/local/bin/ echidna.exe

- name: Generate artifact name
id: artifact-name
run: |
case "$OS-$ARCH" in
macOS-ARM64)
NAME="aarch64-macos"
;;
macOS-X64)
NAME="x86_64-macos"
;;
Windows-X64)
NAME="x86_64-windows"
;;
Linux-X64)
NAME="x86_64-linux"
;;
*)
echo "Unknown os-arch combo: ${OS}-${ARCH}"
exit 1
;;
esac
echo "name=${NAME}" >> "$GITHUB_OUTPUT"
env:
OS: ${{ runner.os }}
ARCH: ${{ runner.arch }}

- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: echidna-${{ runner.os }}
name: echidna-${{ steps.artifact-name.outputs.name }}
path: echidna.tar.gz

- name: Build and copy test suite
Expand Down