|
7 | 7 | - develop
|
8 | 8 | - main
|
9 | 9 |
|
| 10 | +permissions: |
| 11 | + contents: read |
| 12 | + |
10 | 13 | jobs:
|
11 |
| - latest-cabal: |
| 14 | + config: |
| 15 | + name: "Load configuration" |
| 16 | + runs-on: ubuntu-latest |
| 17 | + outputs: |
| 18 | + ghcvers: ${{ steps.set-ghcvers.outputs.ghcvers }} |
| 19 | + ghcvers_lower: ${{ steps.set-ghcvers.outputs.ghcvers_lower }} |
| 20 | + ghcvers_upper: ${{ steps.set-ghcvers.outputs.ghcvers_upper }} |
| 21 | + steps: |
| 22 | + - name: Checkout |
| 23 | + uses: actions/checkout@v4 |
| 24 | + - name: Set ghcvers |
| 25 | + id: set-ghcvers |
| 26 | + run: ./test-all.sh github >> $GITHUB_OUTPUT |
| 27 | + |
| 28 | + cabal: |
12 | 29 | name: "Cabal: GHC ${{ matrix.ghc }}"
|
| 30 | + needs: config |
13 | 31 | runs-on: ubuntu-latest
|
14 | 32 | strategy:
|
| 33 | + fail-fast: false |
15 | 34 | matrix:
|
16 |
| - ghc: ['8.2.2', '8.4.4', '8.6.5', '8.8.4', '8.10.7', '9.0.2', '9.2.1'] |
| 35 | + ghc: ${{fromJSON(needs.config.outputs.ghcvers)}} |
17 | 36 | steps:
|
18 | 37 | - name: Checkout
|
19 |
| - uses: actions/checkout@v2 |
| 38 | + uses: actions/checkout@v4 |
20 | 39 | - name: Setup Haskell
|
21 |
| - uses: haskell/actions/setup@v1 |
| 40 | + uses: haskell-actions/setup@v2 |
| 41 | + id: setup |
22 | 42 | with:
|
23 | 43 | ghc-version: ${{ matrix.ghc }}
|
24 | 44 | cabal-version: latest
|
| 45 | + cabal-update: true |
| 46 | + - name: Setup Environment |
| 47 | + run: | |
| 48 | + GHC_VERSION=$(ghc --numeric-version) |
| 49 | + echo "GHC_VERSION=${GHC_VERSION}" | tee -a "${GITHUB_ENV}" |
| 50 | + CABAL_VERSION=$(cabal --numeric-version) |
| 51 | + echo "CABAL_VERSION=${CABAL_VERSION}" | tee -a "${GITHUB_ENV}" |
| 52 | + CABAL_OPTS="--enable-tests --enable-benchmarks" |
| 53 | + if [ -f "cabal-${GHC_VERSION}.project" ] ; then |
| 54 | + CABAL_OPTS="--project-file=cabal-${GHC_VERSION}.project ${CABAL_OPTS}" |
| 55 | + fi |
| 56 | + echo "CABAL_OPTS=${CABAL_OPTS}" | tee -a "${GITHUB_ENV}" |
| 57 | + CACHE_RESTORE_KEY="${RUNNER_OS}-$(date +%Y%m)-ghc-${GHC_VERSION}-cabal-${CABAL_VERSION}-" |
| 58 | + echo "CACHE_RESTORE_KEY=${CACHE_RESTORE_KEY}" | tee -a "${GITHUB_ENV}" |
| 59 | + - name: Configure Build |
| 60 | + run: | |
| 61 | + cabal v2-configure $CABAL_OPTS --disable-documentation |
| 62 | + cabal v2-build --dry-run $CABAL_OPTS |
| 63 | + - name: Restore Cached Dependencies |
| 64 | + uses: actions/cache/restore@v4 |
| 65 | + id: cache |
| 66 | + with: |
| 67 | + path: ${{ steps.setup.outputs.cabal-store }} |
| 68 | + key: ${{ env.CACHE_RESTORE_KEY }}plan-${{ hashFiles('**/plan.json') }} |
| 69 | + restore-keys: ${{ env.CACHE_RESTORE_KEY }} |
| 70 | + - name: Install Dependencies |
| 71 | + run: cabal v2-build all $CABAL_OPTS --only-dependencies |
| 72 | + - name: Save Cached Dependencies |
| 73 | + uses: actions/cache/save@v4 |
| 74 | + if: ${{ !steps.cache.outputs.cache-hit |
| 75 | + || steps.cache.outputs.cache-primary-key != steps.cache.outputs.cache-matched-key }} |
| 76 | + with: |
| 77 | + path: ${{ steps.setup.outputs.cabal-store }} |
| 78 | + key: ${{ steps.cache.outputs.cache-primary-key }} |
25 | 79 | - name: Build
|
26 |
| - run: cabal new-build --enable-tests --enable-benchmarks |
| 80 | + run: cabal v2-build all $CABAL_OPTS |
27 | 81 | - name: Test
|
28 |
| - run: cabal new-test --enable-tests |
| 82 | + run: cabal v2-test all $CABAL_OPTS |
| 83 | + - name: Haddock |
| 84 | + run: cabal v2-haddock all $CABAL_OPTS |
29 | 85 |
|
30 | 86 | stack:
|
31 | 87 | name: "Stack: GHC ${{ matrix.ghc }}"
|
| 88 | + needs: config |
32 | 89 | runs-on: ubuntu-latest
|
33 | 90 | strategy:
|
| 91 | + fail-fast: false |
34 | 92 | matrix:
|
35 |
| - ghc: ['8.2.2', '8.4.4', '8.6.5', '8.8.4', '8.10.7', '9.0.2'] |
| 93 | + ghc: ${{fromJSON(needs.config.outputs.ghcvers)}} |
36 | 94 | steps:
|
37 | 95 | - name: Checkout
|
38 |
| - uses: actions/checkout@v2 |
| 96 | + uses: actions/checkout@v4 |
39 | 97 | - name: Setup Haskell
|
40 |
| - uses: haskell/actions/setup@v1 |
| 98 | + uses: haskell-actions/setup@v2 |
| 99 | + id: setup |
41 | 100 | with:
|
42 | 101 | ghc-version: ${{ matrix.ghc }}
|
43 | 102 | cabal-version: latest
|
| 103 | + cabal-update: true |
44 | 104 | enable-stack: true
|
45 | 105 | stack-version: latest
|
46 |
| - - name: Cache ~/.stack |
47 |
| - uses: actions/cache@v1 |
| 106 | + - name: Setup Environment |
| 107 | + run: | |
| 108 | + GHC_VERSION=$(ghc --numeric-version) |
| 109 | + echo "GHC_VERSION=${GHC_VERSION}" | tee -a "${GITHUB_ENV}" |
| 110 | + CABAL_VERSION=$(cabal --numeric-version) |
| 111 | + echo "CABAL_VERSION=${CABAL_VERSION}" | tee -a "${GITHUB_ENV}" |
| 112 | + STACK_YAML="stack-${GHC_VERSION}.yaml" |
| 113 | + echo "STACK_YAML=${STACK_YAML}" | tee -a "${GITHUB_ENV}" |
| 114 | + CACHE_RESTORE_KEY="${RUNNER_OS}-$(date +%Y%m)-ghc-${GHC_VERSION}-stack-" |
| 115 | + echo "CACHE_RESTORE_KEY=${CACHE_RESTORE_KEY}" | tee -a "${GITHUB_ENV}" |
| 116 | + - name: Cache |
| 117 | + uses: actions/cache@v4 |
48 | 118 | with:
|
49 |
| - path: ~/.stack |
50 |
| - key: ${{ runner.os }}-${{ matrix.ghc }}-stack |
| 119 | + path: | |
| 120 | + ~/.stack |
| 121 | + .stack-work |
| 122 | + key: ${{ env.CACHE_RESTORE_KEY }}${{ hashFiles('ttc.cabal', env.STACK_YAML) }} |
| 123 | + restore-keys: ${{ env.CACHE_RESTORE_KEY }} |
51 | 124 | - name: Build
|
52 | 125 | run: stack build --system-ghc --test --bench --no-run-tests --no-run-benchmarks
|
53 |
| - env: |
54 |
| - STACK_YAML: stack-${{ matrix.ghc }}.yaml |
55 | 126 | - name: Test
|
56 | 127 | run: stack test --system-ghc
|
57 |
| - env: |
58 |
| - STACK_YAML: stack-${{ matrix.ghc }}.yaml |
| 128 | + - name: Haddock |
| 129 | + run: stack haddock --system-ghc |
59 | 130 |
|
60 |
| - cabal: |
61 |
| - name: "Cabal ${{ matrix.cabal }}: GHC 8.2.2" |
| 131 | + bounds-lower: |
| 132 | + name: "Lower Bounds (GHC ${{ matrix.ghc }})" |
| 133 | + needs: config |
| 134 | + runs-on: ubuntu-latest |
| 135 | + strategy: |
| 136 | + fail-fast: false |
| 137 | + matrix: |
| 138 | + ghc: ${{fromJSON(needs.config.outputs.ghcvers_lower)}} |
| 139 | + steps: |
| 140 | + - name: Checkout |
| 141 | + uses: actions/checkout@v4 |
| 142 | + - name: Setup Haskell |
| 143 | + uses: haskell-actions/setup@v2 |
| 144 | + id: setup |
| 145 | + with: |
| 146 | + ghc-version: ${{ matrix.ghc }} |
| 147 | + cabal-version: latest |
| 148 | + cabal-update: true |
| 149 | + - name: Setup Environment |
| 150 | + run: | |
| 151 | + GHC_VERSION=$(ghc --numeric-version) |
| 152 | + echo "GHC_VERSION=${GHC_VERSION}" | tee -a "${GITHUB_ENV}" |
| 153 | + CABAL_VERSION=$(cabal --numeric-version) |
| 154 | + echo "CABAL_VERSION=${CABAL_VERSION}" | tee -a "${GITHUB_ENV}" |
| 155 | + CABAL_OPTS="--enable-tests --enable-benchmarks --project-file=cabal-bounds-lower.project" |
| 156 | + echo "CABAL_OPTS=${CABAL_OPTS}" | tee -a "${GITHUB_ENV}" |
| 157 | + CACHE_RESTORE_KEY="${RUNNER_OS}-$(date +%Y%m)-ghc-${GHC_VERSION}-cabal-${CABAL_VERSION}-" |
| 158 | + echo "CACHE_RESTORE_KEY=${CACHE_RESTORE_KEY}" | tee -a "${GITHUB_ENV}" |
| 159 | + - name: Configure Build |
| 160 | + run: | |
| 161 | + cabal v2-configure $CABAL_OPTS --disable-documentation |
| 162 | + cabal v2-build --dry-run $CABAL_OPTS |
| 163 | + - name: Restore Cached Dependencies |
| 164 | + uses: actions/cache/restore@v4 |
| 165 | + id: cache |
| 166 | + with: |
| 167 | + path: ${{ steps.setup.outputs.cabal-store }} |
| 168 | + key: ${{ env.CACHE_RESTORE_KEY }}plan-${{ hashFiles('**/plan.json') }} |
| 169 | + restore-keys: ${{ env.CACHE_RESTORE_KEY }} |
| 170 | + - name: Install Dependencies |
| 171 | + run: cabal v2-build all $CABAL_OPTS --only-dependencies |
| 172 | + - name: Save Cached Dependencies |
| 173 | + uses: actions/cache/save@v4 |
| 174 | + if: ${{ !steps.cache.outputs.cache-hit |
| 175 | + || steps.cache.outputs.cache-primary-key != steps.cache.outputs.cache-matched-key }} |
| 176 | + with: |
| 177 | + path: ${{ steps.setup.outputs.cabal-store }} |
| 178 | + key: ${{ steps.cache.outputs.cache-primary-key }} |
| 179 | + - name: Build |
| 180 | + run: cabal v2-build all $CABAL_OPTS |
| 181 | + - name: Test |
| 182 | + run: cabal v2-test all $CABAL_OPTS |
| 183 | + - name: Haddock |
| 184 | + run: cabal v2-haddock all $CABAL_OPTS |
| 185 | + |
| 186 | + bounds-upper: |
| 187 | + name: "Upper Bounds (GHC ${{ matrix.ghc }})" |
| 188 | + needs: config |
| 189 | + runs-on: ubuntu-latest |
| 190 | + strategy: |
| 191 | + fail-fast: false |
| 192 | + matrix: |
| 193 | + ghc: ${{fromJSON(needs.config.outputs.ghcvers_upper)}} |
| 194 | + steps: |
| 195 | + - name: Checkout |
| 196 | + uses: actions/checkout@v4 |
| 197 | + - name: Setup Haskell |
| 198 | + uses: haskell-actions/setup@v2 |
| 199 | + id: setup |
| 200 | + with: |
| 201 | + ghc-version: ${{ matrix.ghc }} |
| 202 | + cabal-version: latest |
| 203 | + cabal-update: true |
| 204 | + - name: Setup Environment |
| 205 | + run: | |
| 206 | + GHC_VERSION=$(ghc --numeric-version) |
| 207 | + echo "GHC_VERSION=${GHC_VERSION}" | tee -a "${GITHUB_ENV}" |
| 208 | + CABAL_VERSION=$(cabal --numeric-version) |
| 209 | + echo "CABAL_VERSION=${CABAL_VERSION}" | tee -a "${GITHUB_ENV}" |
| 210 | + CABAL_OPTS="--enable-tests --enable-benchmarks --project-file=cabal-bounds-upper.project" |
| 211 | + echo "CABAL_OPTS=${CABAL_OPTS}" | tee -a "${GITHUB_ENV}" |
| 212 | + CACHE_RESTORE_KEY="${RUNNER_OS}-$(date +%Y%m)-ghc-${GHC_VERSION}-cabal-${CABAL_VERSION}-" |
| 213 | + echo "CACHE_RESTORE_KEY=${CACHE_RESTORE_KEY}" | tee -a "${GITHUB_ENV}" |
| 214 | + - name: Configure Build |
| 215 | + run: | |
| 216 | + cabal v2-configure $CABAL_OPTS --disable-documentation |
| 217 | + cabal v2-build --dry-run $CABAL_OPTS |
| 218 | + - name: Restore Cached Dependencies |
| 219 | + uses: actions/cache/restore@v4 |
| 220 | + id: cache |
| 221 | + with: |
| 222 | + path: ${{ steps.setup.outputs.cabal-store }} |
| 223 | + key: ${{ env.CACHE_RESTORE_KEY }}plan-${{ hashFiles('**/plan.json') }} |
| 224 | + restore-keys: ${{ env.CACHE_RESTORE_KEY }} |
| 225 | + - name: Install Dependencies |
| 226 | + run: cabal v2-build all $CABAL_OPTS --only-dependencies |
| 227 | + - name: Save Cached Dependencies |
| 228 | + uses: actions/cache/save@v4 |
| 229 | + if: ${{ !steps.cache.outputs.cache-hit |
| 230 | + || steps.cache.outputs.cache-primary-key != steps.cache.outputs.cache-matched-key }} |
| 231 | + with: |
| 232 | + path: ${{ steps.setup.outputs.cabal-store }} |
| 233 | + key: ${{ steps.cache.outputs.cache-primary-key }} |
| 234 | + - name: Build |
| 235 | + run: cabal v2-build all $CABAL_OPTS |
| 236 | + - name: Test |
| 237 | + run: cabal v2-test all $CABAL_OPTS |
| 238 | + - name: Haddock |
| 239 | + run: cabal v2-haddock all $CABAL_OPTS |
| 240 | + |
| 241 | + cabal-version: |
| 242 | + name: "Cabal ${{ matrix.cabal }} (GHC ${{ matrix.ghc }})" |
62 | 243 | runs-on: ubuntu-latest
|
63 | 244 | strategy:
|
| 245 | + fail-fast: false |
64 | 246 | matrix:
|
65 |
| - cabal: ['2.4.1.0', '3.0.0.0', '3.2.0.0', '3.4.0.0'] |
| 247 | + cabal: ['3.0.0.0'] |
| 248 | + ghc: ['8.8.4'] |
66 | 249 | steps:
|
67 | 250 | - name: Checkout
|
68 |
| - uses: actions/checkout@v2 |
| 251 | + uses: actions/checkout@v4 |
69 | 252 | - name: Setup Haskell
|
70 |
| - uses: haskell/actions/setup@v1 |
| 253 | + uses: haskell-actions/setup@v2 |
| 254 | + id: setup |
71 | 255 | with:
|
72 |
| - ghc-version: 8.2.2 |
| 256 | + ghc-version: ${{ matrix.ghc }} |
73 | 257 | cabal-version: ${{ matrix.cabal }}
|
| 258 | + cabal-update: true |
| 259 | + - name: Setup Environment |
| 260 | + run: | |
| 261 | + GHC_VERSION=$(ghc --numeric-version) |
| 262 | + echo "GHC_VERSION=${GHC_VERSION}" | tee -a "${GITHUB_ENV}" |
| 263 | + CABAL_VERSION=$(cabal --numeric-version) |
| 264 | + echo "CABAL_VERSION=${CABAL_VERSION}" | tee -a "${GITHUB_ENV}" |
| 265 | + CABAL_OPTS="--enable-tests --enable-benchmarks" |
| 266 | + if [ -f "cabal-${GHC_VERSION}.project" ] ; then |
| 267 | + CABAL_OPTS="--project-file=cabal-${GHC_VERSION}.project ${CABAL_OPTS}" |
| 268 | + fi |
| 269 | + echo "CABAL_OPTS=${CABAL_OPTS}" | tee -a "${GITHUB_ENV}" |
| 270 | + CACHE_RESTORE_KEY="${RUNNER_OS}-$(date +%Y%m)-ghc-${GHC_VERSION}-cabal-${CABAL_VERSION}-" |
| 271 | + echo "CACHE_RESTORE_KEY=${CACHE_RESTORE_KEY}" | tee -a "${GITHUB_ENV}" |
| 272 | + - name: Configure Build |
| 273 | + run: | |
| 274 | + cabal v2-configure $CABAL_OPTS --disable-documentation |
| 275 | + cabal v2-build --dry-run $CABAL_OPTS |
| 276 | + - name: Restore Cached Dependencies |
| 277 | + uses: actions/cache/restore@v4 |
| 278 | + id: cache |
| 279 | + with: |
| 280 | + path: ${{ steps.setup.outputs.cabal-store }} |
| 281 | + key: ${{ env.CACHE_RESTORE_KEY }}plan-${{ hashFiles('**/plan.json') }} |
| 282 | + restore-keys: ${{ env.CACHE_RESTORE_KEY }} |
| 283 | + - name: Install Dependencies |
| 284 | + run: cabal v2-build all $CABAL_OPTS --only-dependencies |
| 285 | + - name: Save Cached Dependencies |
| 286 | + uses: actions/cache/save@v4 |
| 287 | + if: ${{ !steps.cache.outputs.cache-hit |
| 288 | + || steps.cache.outputs.cache-primary-key != steps.cache.outputs.cache-matched-key }} |
| 289 | + with: |
| 290 | + path: ${{ steps.setup.outputs.cabal-store }} |
| 291 | + key: ${{ steps.cache.outputs.cache-primary-key }} |
74 | 292 | - name: Build
|
75 |
| - run: cabal new-build --enable-tests --enable-benchmarks |
| 293 | + run: cabal v2-build all $CABAL_OPTS |
76 | 294 | - name: Test
|
77 |
| - run: cabal new-test --enable-tests |
| 295 | + run: cabal v2-test all $CABAL_OPTS |
| 296 | + - name: Haddock |
| 297 | + run: cabal v2-haddock all $CABAL_OPTS |
0 commit comments