Skip to content

Commit 81ebaf9

Browse files
committed
Use ghcup-setup in CI
1 parent dcf1978 commit 81ebaf9

File tree

2 files changed

+48
-59
lines changed

2 files changed

+48
-59
lines changed

.github/scripts/env.sh

Lines changed: 0 additions & 31 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 48 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,14 @@ jobs:
2828
ghc: '8.6'
2929
steps:
3030
- uses: actions/checkout@v4
31+
32+
- name: Install GHCup
33+
uses: haskell/ghcup-setup@v1
34+
3135
- name: Setup toolchain
3236
run: |
33-
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
37+
ghcup install ghc --set ${{ matrix.ghc }}
38+
ghcup install cabal --set latest
3439
3540
- if: runner.os == 'macOS'
3641
name: Install system deps via brew
@@ -46,7 +51,6 @@ jobs:
4651
restore-keys: ${{ runner.os }}-${{ matrix.ghc }}-
4752
- name: Build
4853
run: |
49-
. ~/.ghcup/env
5054
ghc --version
5155
cabal --version
5256
cabal update
@@ -58,22 +62,29 @@ jobs:
5862
cabal test all --test-show-details=direct
5963
- name: Haddock
6064
run: |
61-
. ~/.ghcup/env
6265
cabal haddock --disable-documentation
6366
6467
redhat-ubi9:
6568
runs-on: ubuntu-24.04
6669
container:
6770
image: redhat/ubi9:latest
6871
steps:
69-
- name: Install
72+
- name: Install prerequisites
7073
run: |
7174
yum install -y gcc gmp gmp-devel make ncurses xz perl autoconf
72-
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | BOOTSTRAP_HASKELL_NONINTERACTIVE=1 BOOTSTRAP_HASKELL_GHC_VERSION=9.4.8 sh
75+
76+
- name: Install GHCup
77+
uses: haskell/ghcup-setup@v1
78+
79+
- name: Setup toolchain
80+
run: |
81+
ghcup install ghc --set latest
82+
ghcup install cabal --set latest
83+
7384
- uses: actions/checkout@v4
85+
7486
- name: Test
7587
run: |
76-
source ~/.ghcup/env
7788
cabal --version
7889
cabal update
7990
autoreconf --version
@@ -85,14 +96,21 @@ jobs:
8596
container:
8697
image: fedora:37
8798
steps:
88-
- name: Install
99+
- name: Install prerequisites
89100
run: |
90101
dnf install -y gcc gmp gmp-devel make ncurses ncurses-compat-libs xz perl autoconf
91-
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | BOOTSTRAP_HASKELL_NONINTERACTIVE=1 sh
102+
103+
- name: Install GHCup
104+
uses: haskell/ghcup-setup@v1
105+
106+
- name: Setup toolchain
107+
run: |
108+
ghcup install ghc --set latest
109+
ghcup install cabal --set latest
110+
92111
- uses: actions/checkout@v4
93112
- name: Test
94113
run: |
95-
source ~/.ghcup/env
96114
cabal --version
97115
cabal update
98116
autoreconf --version
@@ -102,23 +120,14 @@ jobs:
102120
103121
i386:
104122
runs-on: ubuntu-latest
105-
container:
106-
image: i386/ubuntu:bionic
107123
steps:
108-
- name: Install
109-
run: |
110-
apt-get update -y
111-
apt-get install -y autoconf build-essential zlib1g-dev libgmp-dev curl
112-
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | BOOTSTRAP_HASKELL_NONINTERACTIVE=1 BOOTSTRAP_HASKELL_INSTALL_NO_STACK=1 sh
113-
- uses: actions/checkout@v1
114-
- name: Test
115-
run: |
116-
source ~/.ghcup/env
117-
cabal --version
118-
cabal update
119-
autoreconf --version
120-
autoreconf -i
121-
cabal v2-test --constraint 'optparse-applicative -process' --constraint 'QuickCheck +old-random' --constraint 'tasty -unix' all
124+
- name: Checkout code
125+
uses: actions/checkout@v4
126+
127+
- name: Run build (32 bit linux)
128+
uses: docker://hasufell/i386-alpine-haskell:3.12
129+
with:
130+
args: sh -c "apk update && apk add --no-cache autoconf automake make && cabal update && autoreconf --version && autoreconf -i && cabal v2-test --constraint 'optparse-applicative -process' --constraint 'QuickCheck +old-random' --constraint 'tasty -unix' all"
122131

123132
arm:
124133
runs-on: [self-hosted, Linux, ARM64]
@@ -161,14 +170,25 @@ jobs:
161170
- name: Checkout code
162171
uses: actions/checkout@v4
163172

173+
- name: Install prerequisites
174+
run: |
175+
sudo pkg install -y curl gcc gmp gmake ncurses perl5 libffi libiconv git bash misc/compat10x misc/compat11x misc/compat12x gmake autoconf
176+
177+
- name: Install GHCup
178+
uses: haskell/ghcup-setup@v1
179+
180+
- name: Setup toolchain
181+
run: |
182+
ghcup install ghc --set ${{ matrix.ghc }}
183+
ghcup install cabal --set latest
184+
164185
- name: Run build
165186
run: |
166-
pkg install -y curl gcc gmp gmake ncurses perl5 libffi libiconv git bash misc/compat10x misc/compat11x misc/compat12x gmake autoconf
167-
. .github/scripts/env.sh
168-
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
169187
autoreconf --version
170188
autoreconf -i
189+
cabal update
171190
cabal sdist -z -o .
172191
cabal get unix-*.tar.gz
173192
cd unix-*/
174193
cabal test all --test-show-details=direct
194+

0 commit comments

Comments
 (0)