From 96a429e7dc50dcb2b3096655f0e193d840383025 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20L=C3=B3pez?= Date: Mon, 2 Oct 2023 16:49:21 -0300 Subject: [PATCH 1/5] ci: enable M1 runners for CI job --- .github/workflows/ci.yml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 24455b0ab..35b8dc2cc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,7 @@ on: env: # Tag for cache invalidation - CACHE_VERSION: v6 + CACHE_VERSION: v1 jobs: build: @@ -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} @@ -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 @@ -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' @@ -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) @@ -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 @@ -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: | @@ -160,7 +166,7 @@ jobs: - name: Upload artifact uses: actions/upload-artifact@v3 with: - name: echidna-${{ runner.os }} + name: echidna-${{ runner.os }}-${{ runner.arch }} path: echidna.tar.gz - name: Build and copy test suite From 430d49bf7aca25dcc94b31de4d94fd2b20be60ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20L=C3=B3pez?= Date: Thu, 26 Oct 2023 10:02:29 -0300 Subject: [PATCH 2/5] ci: use nicer artifact names Now that we have both Intel and ARM builds, we need to be able to tell them apart. --- .github/workflows/ci.yml | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 35b8dc2cc..ae8403502 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -163,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 }}-${{ runner.arch }} + name: echidna-${{ steps.artifact-name.outputs.name }} path: echidna.tar.gz - name: Build and copy test suite From 0ee721f05197cb11d771d1d6885209f91c086848 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20L=C3=B3pez?= Date: Mon, 2 Oct 2023 18:35:27 -0300 Subject: [PATCH 3/5] Patch haskell setup action for M1 support --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ae8403502..35a90669e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -63,7 +63,7 @@ jobs: openssl:p - name: Install Stack - uses: haskell-actions/setup@v2 + uses: elopez/haskell-actions-setup@m1-support id: stack if: matrix.container == '' with: From 96c2f48e6ed18dfa8d2f83820c905a7b5d7576f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20L=C3=B3pez?= Date: Fri, 27 Oct 2023 09:34:35 -0300 Subject: [PATCH 4/5] ci: container-linux-static: add missing stack config This was not committed with #1096 by mistake. --- .github/container-linux-static/stack-config.yaml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .github/container-linux-static/stack-config.yaml diff --git a/.github/container-linux-static/stack-config.yaml b/.github/container-linux-static/stack-config.yaml new file mode 100644 index 000000000..9b5d485a6 --- /dev/null +++ b/.github/container-linux-static/stack-config.yaml @@ -0,0 +1,5 @@ +extra-include-dirs: +- /usr/include +extra-lib-dirs: +- /lib +- /usr/lib From b86c6e2ddeed2f4654102498fbbf4247efec5dc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20L=C3=B3pez?= Date: Fri, 1 Dec 2023 09:55:21 -0300 Subject: [PATCH 5/5] ci: go back to upstream haskell-actions/setup M1 support has been merged upstream. --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 35a90669e..2df4d4671 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -63,7 +63,7 @@ jobs: openssl:p - name: Install Stack - uses: elopez/haskell-actions-setup@m1-support + uses: haskell-actions/setup@v2.6.0 id: stack if: matrix.container == '' with: