Repository navigation
87 lines (76 loc) · 3.25 KB
/
Copy pathlinux.yml
File metadata and controls
87 lines (76 loc) · 3.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: Linux CI
on: [push, pull_request]
env:
gtksheet_version: 4.3.5
# Allows for rebuilding the cache without bumping the version
gtksheet_cache_version: 1
jobs:
build:
runs-on: ubuntu-26.04
strategy:
fail-fast: false
matrix:
ghc: ['8.4', '8.6', '8.10', '9.0', '9.4', '9.6', '9.8', '9.10', '9.12', '9.14']
steps:
- uses: actions/checkout@v1
# At this point cabal.project refers to cabal files that do not exist,
# hide it so that 'cabal update' does not fail.
- name: Hide cabal project
run: mv cabal.project _cabal.project
- uses: haskell-actions/setup@v2
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: 'latest'
- name: Restore cabal project
run: mv _cabal.project cabal.project
- name: Cache cabal store
uses: actions/cache@v4
with:
path: ~/.cabal/store
key: ${{ runner.os }}-${{ matrix.ghc }}-cabal
- name: Update cabal.project
run: |
./update-cabal-project.sh ubuntu-ci ${{ matrix.ghc }}
# Some GHC versions (9.4, for instance) link through gcc with
# -fuse-ld=gold, and since Ubuntu 26.04 the gold linker is no longer
# part of binutils, but a separate package (binutils-gold).
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libsdl2-dev libgirepository1.0-dev libunwind-dev binutils-gold
./bindings/PKGS.sh deps ubuntu-ci | sudo xargs apt-get install -y
- name: Generate bindings
run: |
pushd bindings
cabal new-update
cabal new-run genBuildInfo $(./PKGS.sh list ubuntu-ci)
popd
- name: Build
run: cabal build all
# Runs the tests in test/haskell-gi-test.cabal: the struct layout
# tests (which compile C code against the development headers
# installed above, so they need a C compiler and pkg-config) and
# the regression tests for reported issues in test/issues; and
# then the haskell-gi doctests.
#
# haskell-gi has a Custom setup, so cabal builds it as a whole
# instead of component by component. If it is tested in the same
# invocation as a package depending on it ("cabal test all"), cabal
# only builds its library, and then fails to find the doctests
# executable. Changing the set of enabled test suites for
# haskell-gi also forces a rebuild of haskell-gi, and of every
# binding depending on it. So we enable the test suites one package
# at a time: first haskell-gi-test, which leaves haskell-gi (and the
# bindings) as built above, and then haskell-gi, which rebuilds
# haskell-gi but nothing depending on it.
- name: Run struct layout and regression tests
run: |
printf 'package haskell-gi-test\n tests: True\n' > cabal.project.local
cabal test haskell-gi-test --test-show-details=direct --allow-newer=sdl2:bytestring
# The target is "haskell-gi:tests" (all the test suites in the
# haskell-gi package), since plain "haskell-gi" refers to the
# library component, which has the same name as the package.
- name: Run doctests
run: |
printf 'package haskell-gi\n tests: True\n' >> cabal.project.local
cabal test haskell-gi:tests --test-show-details=direct --allow-newer=sdl2:bytestring