Updated dockerfile / ci setup
This commit is contained in:
parent
de969f461b
commit
14372a7ce3
2 changed files with 32 additions and 48 deletions
|
|
@ -12,12 +12,8 @@ jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
container:
|
container:
|
||||||
image: haskell:9.10
|
image: elland/haddock2:latest
|
||||||
steps:
|
steps:
|
||||||
- name: Install Node.js (for actions)
|
|
||||||
run: |
|
|
||||||
curl -fsSL https://deb.nodesource.com/setup_22.x | bash -
|
|
||||||
apt-get install -y nodejs
|
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
- name: Check versions
|
- name: Check versions
|
||||||
|
|
@ -49,13 +45,9 @@ jobs:
|
||||||
test:
|
test:
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
container:
|
container:
|
||||||
image: haskell:9.10
|
image: elland/haddock2:latest
|
||||||
needs: build
|
needs: build
|
||||||
steps:
|
steps:
|
||||||
- name: Install Node.js (for actions)
|
|
||||||
run: |
|
|
||||||
curl -fsSL https://deb.nodesource.com/setup_22.x | bash -
|
|
||||||
apt-get install -y nodejs
|
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
- name: Cache Cabal packages
|
- name: Cache Cabal packages
|
||||||
|
|
@ -82,18 +74,11 @@ jobs:
|
||||||
fourmolu:
|
fourmolu:
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
container:
|
container:
|
||||||
image: haskell:9.10
|
image: elland/haddock2:latest
|
||||||
|
needs: build
|
||||||
steps:
|
steps:
|
||||||
- name: Install Node.js (for actions)
|
|
||||||
run: |
|
|
||||||
curl -fsSL https://deb.nodesource.com/setup_22.x | bash -
|
|
||||||
apt-get install -y nodejs
|
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
- name: Update Cabal package index
|
|
||||||
run: cabal update
|
|
||||||
- name: Install fourmolu
|
|
||||||
run: cabal install fourmolu-0.18.0.0
|
|
||||||
- name: Run fourmolu
|
- name: Run fourmolu
|
||||||
run: |
|
run: |
|
||||||
find src test app -name "*.hs" -exec fourmolu --check-idempotence {} \; 2>/dev/null || true
|
find src test app -name "*.hs" -exec fourmolu --check-idempotence {} \; 2>/dev/null || true
|
||||||
|
|
@ -102,18 +87,11 @@ jobs:
|
||||||
hlint:
|
hlint:
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
container:
|
container:
|
||||||
image: haskell:9.10
|
image: elland/haddock2:latest
|
||||||
|
needs: build
|
||||||
steps:
|
steps:
|
||||||
- name: Install Node.js (for actions)
|
|
||||||
run: |
|
|
||||||
curl -fsSL https://deb.nodesource.com/setup_22.x | bash -
|
|
||||||
apt-get install -y nodejs
|
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
- name: Update Cabal package index
|
|
||||||
run: cabal update
|
|
||||||
- name: Install hlint
|
|
||||||
run: cabal install hlint
|
|
||||||
- name: Run hlint
|
- name: Run hlint
|
||||||
run: |
|
run: |
|
||||||
if [ -d src ]; then hlint src/; fi
|
if [ -d src ]; then hlint src/; fi
|
||||||
|
|
|
||||||
46
Dockerfile
46
Dockerfile
|
|
@ -1,30 +1,36 @@
|
||||||
FROM haskell:9.10
|
FROM haskell:9.10.2-bullseye AS builder
|
||||||
|
|
||||||
# Install system dependencies
|
RUN apt-get update && apt-get install -y curl git && rm -rf /var/lib/apt/lists/*
|
||||||
RUN apt-get update && apt-get install -y \
|
|
||||||
git \
|
|
||||||
curl \
|
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
# Install Node.js (for GitHub Actions compatibility)
|
|
||||||
RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - && \
|
RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - && \
|
||||||
apt-get install -y nodejs && \
|
apt-get install -y nodejs && \
|
||||||
rm -rf /var/lib/apt/lists/*
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# Update cabal and install Haskell tools
|
|
||||||
RUN cabal update && \
|
RUN cabal update && \
|
||||||
cabal install --install-method=copy --installdir=/usr/local/bin \
|
cabal install --install-method=copy --installdir=/usr/local/bin \
|
||||||
fourmolu \
|
fourmolu hlint cabal-gild
|
||||||
hlint \
|
|
||||||
cabal-gild
|
|
||||||
|
|
||||||
# Verify installations
|
|
||||||
RUN ghc --version && \
|
|
||||||
cabal --version && \
|
|
||||||
node --version && \
|
|
||||||
fourmolu --version && \
|
|
||||||
hlint --version && \
|
|
||||||
cabal-gild --version
|
|
||||||
|
|
||||||
# Set working directory
|
|
||||||
WORKDIR /workspace
|
WORKDIR /workspace
|
||||||
|
|
||||||
|
FROM haskell:9.10.2-bullseye
|
||||||
|
|
||||||
|
RUN apt-get update && apt-get install -y \
|
||||||
|
libgmp10 \
|
||||||
|
curl \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - && \
|
||||||
|
apt-get install -y nodejs && \
|
||||||
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
RUN cabal update
|
||||||
|
|
||||||
|
COPY --from=builder /usr/local/bin/cabal /usr/local/bin/
|
||||||
|
COPY --from=builder /usr/local/bin/fourmolu /usr/local/bin/
|
||||||
|
COPY --from=builder /usr/local/bin/hlint /usr/local/bin/
|
||||||
|
COPY --from=builder /usr/local/bin/cabal-gild /usr/local/bin/
|
||||||
|
|
||||||
|
WORKDIR /workspace
|
||||||
|
|
||||||
|
CMD [ "bash" ]
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue