Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@ RUN : \
gcc \
git \
gnupg2 \
gpg-agent \
libblas3 \
libc6 \
libedit2 \
libffi-dev \
libfile-homedir-perl \
libgcc1 \
libgdiplus \
libgmp-dev \
libgssapi-krb5-2 \
libicu74 \
liblapack3 \
Expand All @@ -36,6 +38,7 @@ RUN : \
ruby-dev \
unzip \
xdg-user-dirs \
xz-utils \
zlib1g \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
Expand Down Expand Up @@ -118,6 +121,24 @@ RUN : \
&& rm /tmp/node.tar.gz \
&& :

ARG HASKELL_GHC=9.14.1
ARG HASKELL_CABAL=3.18.1.0
ENV \
BOOTSTRAP_HASKELL_ADJUST_CABAL_CONFIG=yes \
BOOTSTRAP_HASKELL_GHC_VERSION=0 \
BOOTSTRAP_HASKELL_INSTALL_NO_STACK=yes \
BOOTSTRAP_HASKELL_MINIMAL=1 \
BOOTSTRAP_HASKELL_NONINTERACTIVE=1 \
CABAL_DIR=/tmp/cabal \
GHCUP_INSTALL_BASE_PREFIX=/opt/haskell \
PATH=/opt/haskell/.ghcup/bin:$PATH
RUN : \
&& echo 'lang: haskell' \
&& curl --proto '=https' --tlsv1.2 --silent --show-error --fail https://get-ghcup.haskell.org | sh \
&& ghcup install ghc "$HASKELL_GHC" --set \
&& ghcup install cabal "$HASKELL_CABAL" --set \
&& :

ARG RUST=1.89.0
ARG RUSTUP_SHA256=c8d03f559a2335693379e1d3eaee76622b2a6580807e63bcd61faea709b9f664
ARG RUSTUP_VERSION=1.28.0
Expand Down
23 changes: 23 additions & 0 deletions bin/test
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,27 @@ def test_can_run_go_hook(tag: str, pc: str, podman: bool) -> None:
_build_and_run(tag, tmpdir, pc, podman=podman)


HASKELL_HOOK = '''\
repos:
- repo: https://github.com/NixOS/nixfmt
rev: v1.5.0
hooks:
- id: nixfmt
'''


def test_can_run_haskell_hook(tag: str, pc: str, podman: bool) -> None:
with tempfile.TemporaryDirectory() as tmpdir:
subprocess.check_call(('git', 'init', tmpdir))
with open(os.path.join(tmpdir, '.pre-commit-config.yaml'), 'w') as f:
f.write(HASKELL_HOOK)
with open(os.path.join(tmpdir, 't.nix'), 'w') as f:
f.write('1\n')
subprocess.check_call(('git', '-C', tmpdir, 'add', '.'))

_build_and_run(tag, tmpdir, pc, podman=podman)


RUST_HOOK = '''\
repos:
- repo: local
Expand Down Expand Up @@ -454,6 +475,8 @@ def main() -> int:
test_can_install_ffi_gem(full_tag)
print(' can run go hooks '.center(79, '='), flush=True)
test_can_run_go_hook(full_tag, pc, podman=args.podman)
print(' can run haskell hooks '.center(79, '='), flush=True)
test_can_run_haskell_hook(full_tag, pc, podman=args.podman)
print(' can run rust hooks '.center(79, '='), flush=True)
test_can_run_rust_hook(full_tag, pc, podman=args.podman)
print(' can run swift hooks '.center(79, '='), flush=True)
Expand Down
Loading