Skip to content

Commit b5db6c0

Browse files
committed
Update CI
1 parent 6483551 commit b5db6c0

File tree

3 files changed

+66
-58
lines changed

3 files changed

+66
-58
lines changed

.github/workflows/ci.yaml

Lines changed: 47 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,55 @@
1+
# Code generated by dhall-to-yaml. DO NOT EDIT.
12
jobs:
23
build:
3-
runs-on: ubuntu-latest
4+
name: "GHC ${{ matrix.ghc }}, Cabal ${{ matrix.cabal }}, OS ${{ matrix.os }}"
5+
"runs-on": "${{ matrix.os }}"
46
steps:
5-
- name: Native dependencies
6-
run: sudo apt install libgmp-dev libgl1-mesa-dev libxcursor-dev libxi-dev libxinerama-dev libxrandr-dev libxxf86vm-dev
7-
- uses: "actions/checkout@v3"
8-
- id: setup-haskell-cabal
9-
uses: "haskell/actions/setup@v2"
10-
with:
11-
cabal-version: "${{ matrix.cabal }}"
12-
enable-stack: false
13-
ghc-version: "${{ matrix.ghc }}"
14-
- name: Update Hackage repository
15-
run: cabal update
16-
- name: cabal.project.local.ci
17-
run: |
18-
if [ -e cabal.project.local.ci ]; then
19-
cp cabal.project.local.ci cabal.project.local
20-
fi
21-
- name: freeze
22-
run: cabal freeze
23-
- uses: "actions/cache@v3"
24-
with:
25-
key: "${{ runner.os }}-${{ matrix.ghc }}-cabal-${{ hashFiles('cabal.project.freeze') }}"
26-
path: |
27-
${{ steps.setup-haskell-cabal.outputs.cabal-store }}
28-
dist-newstyle
29-
- name: Install dependencies
30-
run: cabal build all --enable-tests --enable-benchmarks --only-dependencies
31-
- name: build all
32-
run: cabal build all --enable-tests --enable-benchmarks
33-
- name: test all
34-
run: cabal test all --enable-tests
35-
- name: haddock all
36-
run: cabal haddock all
7+
- name: Native dependencies
8+
run: "sudo apt install libgmp-dev libgl1-mesa-dev libxcursor-dev libxi-dev libxinerama-dev libxrandr-dev libxxf86vm-dev"
9+
- uses: "actions/checkout@v4"
10+
with:
11+
submodules: recursive
12+
- id: "setup-haskell-cabal"
13+
uses: "haskell-actions/setup@v2"
14+
with:
15+
"cabal-version": "${{ matrix.cabal }}"
16+
"ghc-version": "${{ matrix.ghc }}"
17+
- name: Update Hackage repository
18+
run: cabal update
19+
- name: cabal.project.local.ci
20+
run: |
21+
if [ -e cabal.project.local.ci ]; then
22+
cp cabal.project.local.ci cabal.project.local
23+
fi
24+
- name: freeze
25+
run: "cabal freeze --enable-tests --enable-benchmarks"
26+
- uses: "actions/cache@v3"
27+
with:
28+
key: "${{ matrix.os }}-${{ matrix.ghc }}-${{ matrix.cabal}}-${{ hashFiles('cabal.project.freeze') }}"
29+
path: |
30+
${{ steps.setup-haskell-cabal.outputs.cabal-store }}
31+
dist-newstyle
32+
- name: Install dependencies
33+
run: "cabal build all --enable-tests --enable-benchmarks --only-dependencies"
34+
- name: build all
35+
run: "cabal build all --enable-tests --enable-benchmarks"
36+
- name: test all
37+
run: "cabal test all --enable-tests"
38+
- name: haddock all
39+
run: cabal haddock all
3740
strategy:
3841
matrix:
3942
cabal:
40-
- '3.4'
43+
- '3.10'
4144
ghc:
42-
- '9.0.2'
43-
- '8.10.7'
45+
- '9.6.3'
46+
- '9.4.7'
47+
- '9.2.8'
48+
os:
49+
- "ubuntu-latest"
4450
name: Haskell CI
45-
on:
46-
- push
47-
- pull_request
51+
'on':
52+
pull_request: {}
53+
push: {}
54+
schedule:
55+
- cron: "4 20 10 * *"

ci.dhall

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
let haskellCi =
2-
https://raw.githubusercontent.com/sorki/github-actions-dhall/pending/haskell-ci.dhall
2+
https://raw.githubusercontent.com/sorki/github-actions-dhall/main/haskell-ci.dhall
3+
4+
let steps = haskellCi.defaultCabalSteps
35

46
in haskellCi.generalCi
5-
( [ haskellCi.BuildStep.Name
6-
{ name = "Native dependencies"
7-
, run =
8-
"sudo apt install libgmp-dev libgl1-mesa-dev libxcursor-dev libxi-dev libxinerama-dev libxrandr-dev libxxf86vm-dev"
9-
}
10-
]
11-
# haskellCi.matrixSteps
12-
)
13-
( Some
14-
{ ghc = [ haskellCi.GHC.GHC902, haskellCi.GHC.GHC8107 ]
15-
, cabal = [ haskellCi.Cabal.Cabal34 ]
16-
}
7+
( steps
8+
with extraSteps.pre
9+
=
10+
steps.extraSteps.pre
11+
# [ haskellCi.BuildStep.Name
12+
{ name = "Native dependencies"
13+
, run =
14+
"sudo apt install libgmp-dev libgl1-mesa-dev libxcursor-dev libxi-dev libxinerama-dev libxrandr-dev libxxf86vm-dev"
15+
}
16+
]
1717
)
18+
(haskellCi.DhallMatrix::{=} with ghc = haskellCi.defaultGHC3)
1819
: haskellCi.CI.Type

ci.sh

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22
# Script by @fisx
33

44
set -eo pipefail
5-
cd "$( dirname "${BASH_SOURCE[0]}" )"
65

7-
echo "regenerating .github/workflows/ci.yaml..."
6+
# cd into the dir where this script is placed
7+
cd "$( dirname "${BASH_SOURCE[0]}" )"
88

9-
mkdir -p .github/workflows
9+
echo "regenerating .github/workflows/ci.yaml"
1010

11-
# based on https://github.com/vmchale/github-actions-dhall
12-
which dhall-to-yaml || cabal install dhall-yaml
13-
dhall-to-yaml --file ci.dhall > .github/workflows/ci.yaml
11+
which dhall-to-yaml-ng || cabal install dhall-yaml
12+
dhall-to-yaml-ng --generated-comment --file ci.dhall > .github/workflows/ci.yaml

0 commit comments

Comments
 (0)