Skip to content

Commit 2d11e41

Browse files
committed
Add ARM64 emulated CI check
1 parent 6335281 commit 2d11e41

File tree

1 file changed

+53
-1
lines changed

1 file changed

+53
-1
lines changed

.github/workflows/ci.yml

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
name: Validate
1+
name: Validate Docker
22

33
on:
44
pull_request:
55
branches:
66
- master
7+
paths:
8+
- '**/Dockerfile'
9+
- '.github/workflows/**'
710

811
jobs:
912
build-smoke-test:
@@ -47,3 +50,52 @@ jobs:
4750
- uses: hadolint/[email protected]
4851
with:
4952
recursive: true
53+
54+
emulated-architecture-tests:
55+
timeout-minutes: 60
56+
runs-on: ubuntu-latest
57+
name: ${{ matrix.arch }}-${{ matrix.ghc }}-${{ matrix.deb }}
58+
strategy:
59+
fail-fast: false
60+
matrix:
61+
ghc: ['8.10.7', '9.0.2', '9.2.1']
62+
deb: ['buster']
63+
arch: ['aarch64']
64+
include:
65+
- ghc: '8.10.7'
66+
ghc_minor: '8.10'
67+
- ghc: '9.0.2'
68+
ghc_minor: '9.0'
69+
- ghc: '9.2.1'
70+
ghc_minor: '9.2'
71+
- arch: aarch64
72+
docker_platform: arm64
73+
steps:
74+
- uses: actions/checkout@v2
75+
- name: docker build [ ${{ matrix.arch }} ${{ matrix.ghc }}]
76+
uses: uraimo/run-on-arch-action@e9117b926d001f8683802c315b5a134f8c5da3d3
77+
with:
78+
arch: ${{ matrix.arch }}
79+
distro: ${{ matrix.deb }}
80+
githubToken: ${{ github.token }}
81+
install: |
82+
apt-get update
83+
apt-get install -y curl
84+
curl -fsSL https://get.docker.com | sh
85+
run: |
86+
docker build --pull \
87+
--platform "linux/${{ matrix.docker_platform }}" \
88+
-t haskell:${{ matrix.ghc }}-${{ matrix.deb }} \
89+
${{ matrix.ghc_minor }}/${{ matrix.deb }}
90+
echo 'testing..'
91+
docker run \
92+
--platform "linux/${{ matrix.docker_platform }}" \
93+
-t haskell:${{ matrix.ghc }}-${{ matrix.deb }} \
94+
bash -c "cabal update && cabal install --lib hashable"
95+
docker run \
96+
--platform "linux/${{ matrix.docker_platform }}" \
97+
-t haskell:${{ matrix.ghc }}-${{ matrix.deb }} \
98+
bash -c "echo | ghci"
99+
100+
# Running the official tests does not work as we need to hardcode the plaform due to the emulated nature.
101+
# This solution is fairly hacky, but gets us most of benefit of the official tests.

0 commit comments

Comments
 (0)