Skip to content

Commit

Permalink
Build ARM instead of i386 on CI to test 32 bit build (and 64 bit ARM …
Browse files Browse the repository at this point in the history
…as a bonus)
  • Loading branch information
sergv committed Dec 15, 2024
1 parent c4dc738 commit 3e6e343
Showing 1 changed file with 26 additions and 53 deletions.
79 changes: 26 additions & 53 deletions .github/workflows/haskell-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,61 +87,34 @@ jobs:
cabal test --project-file "$project_file" --constraint "atomic-counter +no-cmm" --test-show-details=direct all
cabal bench --project-file "$project_file" --constraint "atomic-counter +no-cmm" --benchmark-options='--stdev 100 --timeout 100' all
i386:
runs-on: ubuntu-latest
container:
image: i386/ubuntu:bionic
# We use github.com/haskell self-hosted runners for ARM testing.
# If they become unavailable in future, put ['armv7', 'aarch64']
# back to emulation jobs above.
arm:
needs: build
runs-on: [self-hosted, Linux, ARM64]
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
ghc:
- "8.6"
- "8.8"
- "8.10"
- "9.0"
- "9.2"
- "9.4"
- "9.6"

arch: [arm32v7, arm64v8]
steps:
- name: Install
run: |
apt-get update -y
apt-get install -y autoconf build-essential zlib1g-dev libgmp-dev curl libncurses5 libtinfo5 libncurses5-dev libtinfo-dev
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | BOOTSTRAP_HASKELL_NONINTERACTIVE=1 BOOTSTRAP_HASKELL_MINIMAL=1 BOOTSTRAP_HASKELL_INSTALL_NO_STACK=1 sh
source ~/.ghcup/env
ghcup install ghc --set ${{ matrix.ghc }}
ghcup install cabal latest
# This version must stay old enough to remain compatible with the container image.
- uses: actions/checkout@v1

- name: Cabal version
run: |
source ~/.ghcup/env
cabal --version
- name: Unpack
run: |
source ~/.ghcup/env
cabal update
cabal sdist --ignore-project --output-directory ..
cd ..
cabal get atomic-counter-*.tar.gz -d default
- name: Build & Test default
run: |
source ~/.ghcup/env
cabal update
project_file="$(pwd)/cabal.project.ci"
cd ../default/atomic-counter-*/
cabal build --project-file "$project_file" all
cabal test --project-file "$project_file" --test-show-details=direct all
cabal bench --project-file "$project_file" --benchmark-options='--stdev 100 --timeout 100' all
- name: Cleanup
uses: docker://hasufell/arm64v8-ubuntu-haskell:focal
with:
args: "find . -mindepth 1 -maxdepth 1 -exec rm -rf -- {} +"

- uses: actions/checkout@v4

- if: matrix.arch == 'arm32v7'
name: Run build (arm32v7 linux)
uses: docker://hasufell/arm32v7-ubuntu-haskell:focal
with:
args: sh -c 'cabal update && (project_file="$(pwd)/cabal.project.ci"; cabal build --project-file "$project_file" all && cabal test --project-file "$project_file" --test-show-details=direct all && cabal bench --project-file "$project_file" --benchmark-options='--stdev 100 --timeout 100' all)'

- if: matrix.arch == 'arm64v8'
name: Run build (arm64v8 linux)
uses: docker://hasufell/arm64v8-ubuntu-haskell:focal
with:
args: sh -c "ghcup install ghc 9.10.1 && cabal update && cabal test -w ~/.ghcup/bin/ghc-9.10.1"
args: sh -c 'ghcup install ghc 9.10.1 && cabal update && (ghc="~/.ghcup/bin/ghc-9.10.1"; project_file="$(pwd)/cabal.project.ci"; cabal build -w "$ghc" --project-file "$project_file" all && cabal test -w "$ghc" --project-file "$project_file" --test-show-details=direct all && cabal bench -w "$ghc" --project-file "$project_file" --benchmark-options="--stdev 100 --timeout 100" all)'

0 comments on commit 3e6e343

Please sign in to comment.