Skip to content

Commit 8081ee8

Browse files
committed
Update CI
1 parent f0b7bf7 commit 8081ee8

File tree

1 file changed

+94
-16
lines changed

1 file changed

+94
-16
lines changed

.github/workflows/test.yaml

Lines changed: 94 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,10 @@ jobs:
1818
os: [ubuntu-latest]
1919
ghc: ['8.8', '8.10', '9.0', '9.2', '9.4', '9.6', '9.8', '9.10']
2020
include:
21-
- os: macOS-latest
21+
- os: macOS-12
2222
ghc: '9.4'
23-
- os: macOS-latest
23+
- os: macOS-12
2424
ghc: '9.6'
25-
- os: macOS-latest
26-
ghc: '9.8'
2725
- os: windows-latest
2826
ghc: '8.10'
2927
- os: windows-latest
@@ -33,30 +31,26 @@ jobs:
3331
- os: windows-latest
3432
ghc: '9.8'
3533
steps:
36-
- uses: actions/checkout@v4
37-
34+
- uses: actions/checkout@v3
3835

3936
- name: Install dependencies (Ubuntu)
4037
if: runner.os == 'Linux'
4138
run: |
4239
sudo apt-get -y update
4340
sudo apt-get -y install libtinfo5 libtinfo6 libncurses5 libncurses6
4441
45-
- if: runner.os != 'Windows'
46-
name: Setup toolchain
42+
- name: Install ghc/cabal
4743
run: |
48-
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | BOOTSTRAP_HASKELL_NONINTERACTIVE=1 BOOTSTRAP_HASKELL_INSTALL_NO_STACK=1 BOOTSTRAP_HASKELL_GHC_VERSION=${{ matrix.ghc }} BOOTSTRAP_HASKELL_ADJUST_BASHRC=yes sh
44+
set -eux
45+
ghcup install ghc --set ${{ matrix.ghc }}
46+
ghcup install cabal ${{ matrix.cabal }}
47+
shell: bash
4948

5049
- name: Build
5150
run: |
5251
set -eux
53-
[ -e ~/.ghcup/env ] && . ~/.ghcup/env
54-
ghcup install ghc --set ${{ matrix.ghc }}
55-
echo ${{ matrix.ghc }}
56-
echo $(ghc --numeric-version)
5752
cabal update
58-
cabal configure --enable-tests --test-show-details=direct
59-
cabal build
53+
cabal build --enable-tests
6054
cabal test
6155
cabal haddock
6256
cabal check
@@ -78,5 +72,89 @@ jobs:
7872
run: |
7973
. ~/.ghcup/env
8074
cabal update
81-
cabal test --test-show-details=direct
75+
cabal test
76+
77+
# We use github.com/haskell self-hosted runners for ARM testing.
78+
# If they become unavailable in future, put ['armv7', 'aarch64']
79+
# back to emulation jobs above.
80+
arm:
81+
runs-on: [self-hosted, Linux, ARM64]
82+
strategy:
83+
fail-fast: true
84+
matrix:
85+
arch: [arm32v7, arm64v8]
86+
steps:
87+
- uses: docker://hasufell/arm64v8-ubuntu-haskell:focal
88+
name: Cleanup
89+
with:
90+
args: "find . -mindepth 1 -maxdepth 1 -exec rm -rf -- {} +"
91+
92+
- name: Checkout code
93+
uses: actions/checkout@v4
94+
95+
- if: matrix.arch == 'arm32v7'
96+
uses: docker://hasufell/arm32v7-ubuntu-haskell:focal
97+
name: Run build (arm32v7 linux)
98+
with:
99+
args: sh -c "cabal update && ghcup install ghc --isolate=/usr --force 9.2.2 && cabal test -w ghc-9.2.2"
100+
101+
- if: matrix.arch == 'arm64v8'
102+
uses: docker://hasufell/arm64v8-ubuntu-haskell:focal
103+
name: Run build (arm64v8 linux)
104+
with:
105+
args: sh -c "cabal update && ghcup install ghc --isolate=/usr --force 9.2.2 && cabal test -w ghc-9.2.2"
106+
107+
darwin_arm:
108+
runs-on: ${{ matrix.os }}
109+
env:
110+
MACOSX_DEPLOYMENT_TARGET: 10.13
111+
strategy:
112+
fail-fast: false
113+
matrix:
114+
include:
115+
- os: [self-hosted, macOS, ARM64]
116+
ghc: 8.10.7
117+
- os: [self-hosted, macOS, ARM64]
118+
ghc: 9.2.8
119+
- os: [self-hosted, macOS, ARM64]
120+
ghc: 9.4.7
121+
steps:
122+
- name: Checkout code
123+
uses: actions/checkout@v4
124+
125+
- name: Run build
126+
run: |
127+
bash .github/scripts/brew.sh git coreutils llvm@13 autoconf automake
128+
export PATH="$HOME/.brew/bin:$HOME/.brew/sbin:$HOME/.brew/opt/llvm@13/bin:$PATH"
129+
export CC="$HOME/.brew/opt/llvm@13/bin/clang"
130+
export CXX="$HOME/.brew/opt/llvm@13/bin/clang++"
131+
export LD=ld
132+
export AR="$HOME/.brew/opt/llvm@13/bin/llvm-ar"
133+
export RANLIB="$HOME/.brew/opt/llvm@13/bin/llvm-ranlib"
134+
. .github/scripts/env.sh
135+
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | BOOTSTRAP_HASKELL_NONINTERACTIVE=1 BOOTSTRAP_HASKELL_INSTALL_NO_STACK=1 BOOTSTRAP_HASKELL_GHC_VERSION=${{ matrix.ghc }} BOOTSTRAP_HASKELL_ADJUST_BASHRC=yes sh
136+
cabal test
137+
env:
138+
HOMEBREW_CHANGE_ARCH_TO_ARM: 1
139+
140+
freebsd:
141+
runs-on: ${{ matrix.os }}
142+
strategy:
143+
fail-fast: false
144+
matrix:
145+
include:
146+
- os: [self-hosted, FreeBSD, X64]
147+
ghc: 9.4.8
148+
- os: [self-hosted, FreeBSD, X64]
149+
ghc: 9.6.4
150+
steps:
151+
- name: Checkout code
152+
uses: actions/checkout@v4
153+
154+
- name: Run build
155+
run: |
156+
pkg install -y curl gcc gmp gmake ncurses perl5 libffi libiconv git bash misc/compat10x misc/compat11x misc/compat12x gmake llvm14
157+
. .github/scripts/env.sh
158+
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | BOOTSTRAP_HASKELL_NONINTERACTIVE=1 BOOTSTRAP_HASKELL_INSTALL_NO_STACK=1 BOOTSTRAP_HASKELL_GHC_VERSION=${{ matrix.ghc }} BOOTSTRAP_HASKELL_ADJUST_BASHRC=yes sh
159+
cabal test
82160

0 commit comments

Comments
 (0)