Skip to content

Commit 954555b

Browse files
committed
Containerize CI builds
- add Dockerfile - resulting image is deployed at ghcr.io/ulysses4ever/lh-array-sort - CI scripts pull this image
1 parent c66e51d commit 954555b

File tree

3 files changed

+31
-41
lines changed

3 files changed

+31
-41
lines changed

.github/workflows/build-liquid.yaml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,17 @@ on:
1616
- "**/README.md"
1717
workflow_dispatch:
1818

19+
env:
20+
CABAL_DIR: '/cabal-dir' # due to container; see top-level Dockerfile
21+
1922
jobs:
2023
main:
2124
runs-on: ubuntu-latest
25+
container: ghcr.io/ulysses4ever/lh-array-sort
2226
steps:
2327

2428
- uses: actions/checkout@v4
2529

26-
- name: Setup Z3
27-
uses: cda-tum/setup-z3@v1
28-
29-
- uses: haskell-actions/setup@v2
30-
with:
31-
ghc-version: 9.10.1
32-
cabal-version: 3.14
33-
3430
# See the following link for a breakdown of the following step
3531
# https://github.com/haskell/actions/issues/7#issuecomment-745697160
3632
- uses: actions/cache@v4
@@ -43,4 +39,5 @@ jobs:
4339
restore-keys: ${{ runner.os }}-${{ matrix.ghc }}-
4440

4541
- name: Build in liquid mode
46-
run: cabal build lh-array-sort
42+
run: |
43+
cabal build lh-array-sort

.github/workflows/build-test-linear.yaml

Lines changed: 7 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,17 @@ on:
1616
- "**/README.md"
1717
workflow_dispatch:
1818

19+
env:
20+
CABAL_DIR: '/cabal-dir'
21+
1922
jobs:
2023
test-mutable-arrays:
2124
runs-on: ubuntu-latest
25+
container: ghcr.io/ulysses4ever/lh-array-sort
2226
steps:
2327

2428
- uses: actions/checkout@v4
2529

26-
- name: Setup Z3
27-
uses: cda-tum/setup-z3@v1
28-
29-
- uses: haskell-actions/setup@v2
30-
with:
31-
ghc-version: 9.10.1
32-
cabal-version: 3.14
33-
3430
# See the following link for a breakdown of the following step
3531
# https://github.com/haskell/actions/issues/7#issuecomment-745697160
3632
- uses: actions/cache@v4
@@ -54,18 +50,11 @@ jobs:
5450

5551
test-prim-mutable-arrays:
5652
runs-on: ubuntu-latest
53+
container: ghcr.io/ulysses4ever/lh-array-sort
5754
steps:
5855

5956
- uses: actions/checkout@v4
6057

61-
- name: Setup Z3
62-
uses: cda-tum/setup-z3@v1
63-
64-
- uses: haskell-actions/setup@v2
65-
with:
66-
ghc-version: 9.10.1
67-
cabal-version: 3.14
68-
6958
- uses: actions/cache@v4
7059
with:
7160
path: |
@@ -86,18 +75,11 @@ jobs:
8675

8776
test-pure-arrays:
8877
runs-on: ubuntu-latest
78+
container: ghcr.io/ulysses4ever/lh-array-sort
8979
steps:
9080

9181
- uses: actions/checkout@v4
9282

93-
- name: Setup Z3
94-
uses: cda-tum/setup-z3@v1
95-
96-
- uses: haskell-actions/setup@v2
97-
with:
98-
ghc-version: 9.10.1
99-
cabal-version: 3.14
100-
10183
- uses: actions/cache@v4
10284
with:
10385
path: |
@@ -119,18 +101,11 @@ jobs:
119101

120102
run-benchrunner:
121103
runs-on: ubuntu-latest
104+
container: ghcr.io/ulysses4ever/lh-array-sort
122105
steps:
123106

124107
- uses: actions/checkout@v4
125108

126-
- name: Setup Z3
127-
uses: cda-tum/setup-z3@v1
128-
129-
- uses: haskell-actions/setup@v2
130-
with:
131-
ghc-version: 9.10.1
132-
cabal-version: 3.14
133-
134109
- uses: actions/cache@v4
135110
with:
136111
path: |

Dockerfile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
FROM benz0li/ghc-musl:9.10.1
2+
3+
RUN apk upgrade --no-cache \
4+
&& apk add --no-cache \
5+
z3 git
6+
7+
RUN mkdir cabal-dir \
8+
&& export CABAL_DIR=/cabal-dir \
9+
&& cabal update \
10+
&& git clone https://github.com/michaelborkowski/lh-array-sort-new.git app \
11+
&& cd app \
12+
&& cabal configure --constraint="lh-array-sort -liquid-checks +prim-mutable-arrays" --enable-tests \
13+
&& cabal build all \
14+
&& cabal test \
15+
&& cd .. \
16+
&& rm -rf /app
17+
18+
CMD ["bash"]

0 commit comments

Comments
 (0)