Skip to content

Commit 3eeb1cd

Browse files
committed
Build mwc-random with both random-1.2 & 1.3
1 parent 2cce257 commit 3eeb1cd

File tree

2 files changed

+108
-47
lines changed

2 files changed

+108
-47
lines changed

.github/workflows/ci.yml

Lines changed: 106 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -12,57 +12,73 @@ defaults:
1212

1313
jobs:
1414
cabal:
15-
name: ${{ matrix.os }} / ghc ${{ matrix.ghc }}
15+
name: ${{ matrix.os }} / ghc ${{ matrix.ghc }} [${{ matrix.random }}]
1616
runs-on: ${{ matrix.os }}
1717
strategy:
1818
matrix:
1919
include:
2020
### -- Linux --
21-
- { cabal: "3.12", os: ubuntu-latest, ghc: "8.0.2" }
22-
- { cabal: "3.12", os: ubuntu-latest, ghc: "8.2.2" }
23-
- { cabal: "3.12", os: ubuntu-latest, ghc: "8.4.4" }
24-
- { cabal: "3.12", os: ubuntu-latest, ghc: "8.6.5" }
25-
- { cabal: "3.12", os: ubuntu-latest, ghc: "8.8.4" }
26-
- { cabal: "3.12", os: ubuntu-latest, ghc: "8.10.7" }
27-
- { cabal: "3.12", os: ubuntu-latest, ghc: "9.0.2" }
28-
- { cabal: "3.12", os: ubuntu-latest, ghc: "9.2.8" }
29-
- { cabal: "3.12", os: ubuntu-latest, ghc: "9.4.8" }
30-
- { cabal: "3.12", os: ubuntu-latest, ghc: "9.6.6" }
31-
- { cabal: "3.12", os: ubuntu-latest, ghc: "9.8.4" }
32-
- { cabal: "3.12", os: ubuntu-latest, ghc: "9.10.1" }
33-
- { cabal: "3.12", os: ubuntu-latest, ghc: "9.12.1" }
34-
## -- Win --
35-
- { cabal: "3.12", os: windows-latest, ghc: "8.4.4" }
36-
- { cabal: "3.12", os: windows-latest, ghc: "8.6.5" }
37-
- { cabal: "3.12", os: windows-latest, ghc: "8.8.4" }
38-
- { cabal: "3.12", os: windows-latest, ghc: "8.10.7" }
39-
- { cabal: "3.12", os: windows-latest, ghc: "9.0.2" }
40-
- { cabal: "3.12", os: windows-latest, ghc: "9.2.8" }
41-
- { cabal: "3.12", os: windows-latest, ghc: "9.4.8" }
42-
- { cabal: "3.12", os: windows-latest, ghc: "9.6.6" }
43-
- { cabal: "3.12", os: windows-latest, ghc: "9.8.4" }
44-
- { cabal: "3.12", os: windows-latest, ghc: "9.10.1" }
45-
- { cabal: "3.12", os: windows-latest, ghc: "9.12.1" }
46-
# MacOS
47-
- { cabal: "3.12", os: macOS-13, ghc: "8.4.4" }
48-
- { cabal: "3.12", os: macOS-13, ghc: "8.6.5" }
49-
- { cabal: "3.12", os: macOS-13, ghc: "8.8.4" }
50-
- { cabal: "3.12", os: macOS-13, ghc: "8.10.7" }
51-
- { cabal: "3.12", os: macOS-13, ghc: "9.0.2" }
52-
- { cabal: "3.12", os: macOS-latest, ghc: "9.2.8" }
53-
- { cabal: "3.12", os: macOS-latest, ghc: "9.4.8" }
54-
- { cabal: "3.12", os: macOS-latest, ghc: "9.6.6" }
55-
- { cabal: "3.12", os: macOS-latest, ghc: "9.8.4" }
56-
- { cabal: "3.12", os: macOS-latest, ghc: "9.10.1" }
57-
- { cabal: "3.12", os: macOS-latest, ghc: "9.12.1" }
21+
# - { cabal: "3.12", os: ubuntu-latest, ghc: "8.0.2", random: "1.2" }
22+
# - { cabal: "3.12", os: ubuntu-latest, ghc: "8.2.2", random: "1.2" }
23+
# - { cabal: "3.12", os: ubuntu-latest, ghc: "8.4.4", random: "1.2" }
24+
# - { cabal: "3.12", os: ubuntu-latest, ghc: "8.6.5", random: "1.2" }
25+
# - { cabal: "3.12", os: ubuntu-latest, ghc: "8.8.4", random: "1.2" }
26+
# - { cabal: "3.12", os: ubuntu-latest, ghc: "8.10.7", random: "1.2" }
27+
# - { cabal: "3.12", os: ubuntu-latest, ghc: "9.0.2", random: "1.2" }
28+
# - { cabal: "3.12", os: ubuntu-latest, ghc: "9.2.8", random: "1.2" }
29+
# - { cabal: "3.12", os: ubuntu-latest, ghc: "9.4.8", random: "1.2" }
30+
- { cabal: "3.12", os: ubuntu-latest, ghc: "9.6.6", random: "1.2" }
31+
# - { cabal: "3.12", os: ubuntu-latest, ghc: "9.8.4", random: "1.2" }
32+
# - { cabal: "3.12", os: ubuntu-latest, ghc: "9.10.1", random: "1.2" }
33+
# - { cabal: "3.12", os: ubuntu-latest, ghc: "9.12.1", random: "1.2" }
34+
35+
# - { cabal: "3.12", os: ubuntu-latest, ghc: "8.0.2", random: "1.3" }
36+
# - { cabal: "3.12", os: ubuntu-latest, ghc: "8.2.2", random: "1.3" }
37+
# - { cabal: "3.12", os: ubuntu-latest, ghc: "8.4.4", random: "1.3" }
38+
# - { cabal: "3.12", os: ubuntu-latest, ghc: "8.6.5", random: "1.3" }
39+
# - { cabal: "3.12", os: ubuntu-latest, ghc: "8.8.4", random: "1.3" }
40+
# - { cabal: "3.12", os: ubuntu-latest, ghc: "8.10.7", random: "1.3" }
41+
# - { cabal: "3.12", os: ubuntu-latest, ghc: "9.0.2", random: "1.3" }
42+
# - { cabal: "3.12", os: ubuntu-latest, ghc: "9.2.8", random: "1.3" }
43+
# - { cabal: "3.12", os: ubuntu-latest, ghc: "9.4.8", random: "1.3" }
44+
- { cabal: "3.12", os: ubuntu-latest, ghc: "9.6.6", random: "1.3" }
45+
# - { cabal: "3.12", os: ubuntu-latest, ghc: "9.8.4", random: "1.3" }
46+
# - { cabal: "3.12", os: ubuntu-latest, ghc: "9.10.1", random: "1.3" }
47+
# - { cabal: "3.12", os: ubuntu-latest, ghc: "9.12.1", random: "1.3" }
48+
# ## -- Win --
49+
# - { cabal: "3.12", os: windows-latest, ghc: "8.4.4" }
50+
# - { cabal: "3.12", os: windows-latest, ghc: "8.6.5" }
51+
# - { cabal: "3.12", os: windows-latest, ghc: "8.8.4" }
52+
# - { cabal: "3.12", os: windows-latest, ghc: "8.10.7" }
53+
# - { cabal: "3.12", os: windows-latest, ghc: "9.0.2" }
54+
# - { cabal: "3.12", os: windows-latest, ghc: "9.2.8" }
55+
# - { cabal: "3.12", os: windows-latest, ghc: "9.4.8" }
56+
# - { cabal: "3.12", os: windows-latest, ghc: "9.6.6" }
57+
# - { cabal: "3.12", os: windows-latest, ghc: "9.8.4" }
58+
# - { cabal: "3.12", os: windows-latest, ghc: "9.10.1" }
59+
# - { cabal: "3.12", os: windows-latest, ghc: "9.12.1" }
60+
# # MacOS
61+
# - { cabal: "3.12", os: macOS-13, ghc: "8.4.4" }
62+
# - { cabal: "3.12", os: macOS-13, ghc: "8.6.5" }
63+
# - { cabal: "3.12", os: macOS-13, ghc: "8.8.4" }
64+
# - { cabal: "3.12", os: macOS-13, ghc: "8.10.7" }
65+
# - { cabal: "3.12", os: macOS-13, ghc: "9.0.2" }
66+
# - { cabal: "3.12", os: macOS-latest, ghc: "9.2.8" }
67+
# - { cabal: "3.12", os: macOS-latest, ghc: "9.4.8" }
68+
# - { cabal: "3.12", os: macOS-latest, ghc: "9.6.6" }
69+
# - { cabal: "3.12", os: macOS-latest, ghc: "9.8.4" }
70+
# - { cabal: "3.12", os: macOS-latest, ghc: "9.10.1" }
71+
# - { cabal: "3.12", os: macOS-latest, ghc: "9.12.1" }
5872
fail-fast: false
5973

6074
steps:
6175
# ----------------
6276
- name: "Dummy"
6377
run: |
64-
echo M1 ${{ matrix.ghc }}
65-
echo M2 ${{ matrix.skip-bench }}
78+
echo "Cabal " ${{ matrix.cabal }}
79+
echo "OS " ${{ matrix.os }}
80+
echo "GHC " ${{ matrix.ghc }}
81+
echo "random" ${{ matrix.random }}
6682
# ----------------
6783
- uses: actions/checkout@v4
6884
# ----------------
@@ -94,29 +110,72 @@ jobs:
94110
run: |
95111
mkdir sdist
96112
cabal sdist -o sdist
113+
# ----------------
97114
- name: Unpack
98115
run: |
99116
mkdir unpacked
100117
tar -C unpacked -xzf sdist/mwc-random*tar.gz
101-
cd unpacked
118+
ls unpacked
119+
# ----------------
120+
- name: Configure
121+
working-directory: ./unpacked
122+
run: |
123+
pwd
124+
ls
125+
echo "packages: mwc-random*/mwc-random.cabal" > cabal.project
126+
#--
127+
if [ "${{ matrix.skip-test }}" == "" ]; then
128+
echo "tests: True" >> cabal.project
129+
else
130+
echo "tests: False" >> cabal.project
131+
fi
132+
#--
133+
if [ "${{ matrix.skip-bench }}" == "" ]; then
134+
echo "benchmarks: True" >> cabal.project
135+
echo "benchmark-options: -l" >> cabal.project
136+
else
137+
echo "benchmarks: False" >> cabal.project
138+
fi
139+
#--
140+
if [ ${{ matrix.random }} == "1.2" ]; then
141+
echo "constraints: random >=1.2 && <1.3" >> cabal.project
142+
elif [ ${{ matrix.random }} == "1.3" ]; then
143+
echo "constraints: random >=1.3 && <1.4" >> cabal.project
144+
echo "allow-newer: QuickCheck-2.15.0.1:random" >> cabal.project
145+
fi
146+
#
147+
cabal configure $FLAG_PAPI
148+
cabal freeze
149+
cat cabal.project
150+
echo ========================================
151+
cat cabal.project.freeze
102152
# ----------------
103153
- name: cabal check
154+
working-directory: ./unpacked
104155
run: |
105-
cabal -vnormal check
156+
pwd
157+
for nm in mwc-random-*; do
158+
if [ -d "$nm" ]; then
159+
cd "$nm"
160+
cabal -vnormal check
161+
cd ..
162+
fi
163+
done
106164
# ----------------
107165
- name: Build
166+
working-directory: ./unpacked
108167
run: |
109-
if [ "${{ matrix.skip-test }}" == "" ]; then FLAG_TEST=--enable-test; fi
110-
if [ "${{ matrix.skip-bench }}" == "" ]; then
111-
FLAG_BENCH="--enable-benchmarks --benchmark-option=-l"
112-
fi
113-
cabal configure $FLAG_TEST $FLAG_BENCH $FLAG_PAPI --haddock-all
168+
pwd
114169
cabal build all --write-ghc-environment-files=always
115170
# ----------------
116171
- name: Test
172+
working-directory: ./unpacked
117173
run: |
174+
pwd
118175
cabal test all
119176
# ----------------
120177
- name: Bench
178+
working-directory: ./unpacked
121179
run: |
180+
pwd
122181
cabal bench all

cabal.project

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
packages:
22
mwc-random.cabal
3+
constraints: random >=1.3 && <1.4
4+
allow-newer: QuickCheck:random

0 commit comments

Comments
 (0)