Skip to content

Commit 23cbcf9

Browse files
committed
Update CI pattern to work with alpine better
1 parent 980ca11 commit 23cbcf9

File tree

5 files changed

+158
-101
lines changed

5 files changed

+158
-101
lines changed

.github/workflows/alpine.yml

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Validate Alpine
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
paths:
8+
- '**/alpine*/Dockerfile'
9+
- '.github/workflows/alpine.yml'
10+
11+
jobs:
12+
build-smoke-test:
13+
timeout-minutes: 30
14+
runs-on: ubuntu-latest
15+
name: ${{ matrix.ghc }}-alpine${{ matrix.os_version }}
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
ghc: ['9.0.2', '9.2.1']
20+
os_version: ['3.14', '3.15']
21+
include:
22+
- ghc: '9.0.2'
23+
ghc_minor: '9.0'
24+
- ghc: '9.2.1'
25+
ghc_minor: '9.2'
26+
steps:
27+
- uses: actions/checkout@v2
28+
- name: build + smoke test [${{ matrix.ghc }}]
29+
uses: nick-invision/retry@v2
30+
with:
31+
timeout_minutes: 8
32+
max_attempts: 3
33+
command: |
34+
docker build --pull \
35+
-t haskell:${{ matrix.ghc }}-alpine${{ matrix.os_version }} \
36+
${{ matrix.ghc_minor }}/alpine${{ matrix.os_version }}
37+
- uses: actions/checkout@v2
38+
with:
39+
repository: AlistairB/official-images
40+
ref: haskell-sh
41+
path: official-images
42+
- name: run official-images tests
43+
run: ./official-images/test/run.sh haskell:${{ matrix.ghc }}-alpine${{ matrix.os_version }}

.github/workflows/ci.yml

-101
This file was deleted.

.github/workflows/debian.yml

+96
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
name: Validate Debian
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
paths:
8+
- '**/buster/Dockerfile'
9+
- '.github/workflows/debian.yml'
10+
11+
jobs:
12+
build-smoke-test:
13+
timeout-minutes: 30
14+
runs-on: ubuntu-latest
15+
name: ${{ matrix.ghc }}-${{ matrix.deb }}
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
ghc: ['8.10.7', '9.0.2', '9.2.1']
20+
deb: ['buster']
21+
include:
22+
- ghc: '8.10.7'
23+
ghc_minor: '8.10'
24+
- ghc: '9.0.2'
25+
ghc_minor: '9.0'
26+
- ghc: '9.2.1'
27+
ghc_minor: '9.2'
28+
steps:
29+
- uses: actions/checkout@v2
30+
- name: build + smoke test [${{ matrix.ghc }}]
31+
uses: nick-invision/retry@v2
32+
with:
33+
timeout_minutes: 8
34+
max_attempts: 3
35+
command: |
36+
docker build --pull \
37+
-t haskell:${{ matrix.ghc }}-${{ matrix.deb }} \
38+
${{ matrix.ghc_minor }}/${{ matrix.deb }}
39+
- uses: actions/checkout@v2
40+
with:
41+
repository: AlistairB/official-images
42+
ref: haskell-sh
43+
path: official-images
44+
- name: run official-images tests
45+
run: ./official-images/test/run.sh haskell:${{ matrix.ghc }}-${{ matrix.deb }}
46+
47+
# disable while I play
48+
49+
# emulated-architecture-tests:
50+
# timeout-minutes: 60
51+
# runs-on: ubuntu-latest
52+
# name: ${{ matrix.arch }}-${{ matrix.ghc }}-${{ matrix.deb }}
53+
# strategy:
54+
# fail-fast: false
55+
# matrix:
56+
# ghc: ['8.10.7', '9.0.2', '9.2.1']
57+
# deb: ['buster']
58+
# arch: ['aarch64']
59+
# include:
60+
# - ghc: '8.10.7'
61+
# ghc_minor: '8.10'
62+
# - ghc: '9.0.2'
63+
# ghc_minor: '9.0'
64+
# - ghc: '9.2.1'
65+
# ghc_minor: '9.2'
66+
# - arch: aarch64
67+
# docker_platform: arm64
68+
# steps:
69+
# - uses: actions/checkout@v2
70+
# - name: docker build [ ${{ matrix.arch }} ${{ matrix.ghc }}]
71+
# uses: uraimo/run-on-arch-action@e9117b926d001f8683802c315b5a134f8c5da3d3
72+
# with:
73+
# arch: ${{ matrix.arch }}
74+
# distro: ${{ matrix.deb }}
75+
# githubToken: ${{ github.token }}
76+
# install: |
77+
# apt-get update
78+
# apt-get install -y curl
79+
# curl -fsSL https://get.docker.com | sh
80+
# run: |
81+
# docker build --pull \
82+
# --platform "linux/${{ matrix.docker_platform }}" \
83+
# -t haskell:${{ matrix.ghc }}-${{ matrix.deb }} \
84+
# ${{ matrix.ghc_minor }}/${{ matrix.deb }}
85+
# echo 'testing..'
86+
# docker run \
87+
# --platform "linux/${{ matrix.docker_platform }}" \
88+
# -t haskell:${{ matrix.ghc }}-${{ matrix.deb }} \
89+
# bash -c "cabal update && cabal install --lib hashable"
90+
# docker run \
91+
# --platform "linux/${{ matrix.docker_platform }}" \
92+
# -t haskell:${{ matrix.ghc }}-${{ matrix.deb }} \
93+
# bash -c "echo | ghci"
94+
95+
# Running the official tests does not work as we need to hardcode the plaform due to the emulated nature.
96+
# This solution is fairly hacky, but gets us most of benefit of the official tests.

.github/workflows/lint.yml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Hadolint
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
paths:
8+
- '**/Dockerfile'
9+
- '.github/workflows/lint.yml'
10+
11+
jobs:
12+
hadolint:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v2
16+
- uses: hadolint/[email protected]
17+
with:
18+
recursive: true

.hadolint.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ ignored:
22
# https://github.com/hadolint/hadolint/wiki/DL3008
33
# Don't want to micro manage the dependency versions.
44
- DL3008
5+
- DL3018
56
# https://github.com/hadolint/hadolint/wiki/DL3003
67
# Using cd /tmp is a very convenient way to clean up after a step.
78
- DL3003

0 commit comments

Comments
 (0)