Skip to content

Commit

Permalink
ci: do cabal update inside the image
Browse files Browse the repository at this point in the history
  • Loading branch information
stevana committed Oct 22, 2024
1 parent b7139db commit 7b85f3d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,13 @@ jobs:
-v "${HOME}/.cabal/packages":/root/.cache/cabal/packages \
-v "${HOME}/.cabal/store":/root/.local/state/cabal/store \
-v "${PWD}/dist-newstyle":/mnt/dist-newstyle \
--entrypoint=cabal \
ghcr.io/spex-lang/static-build:9.6.6 \
configure --enable-tests --enable-benchmarks --disable-documentation --project-dir=/mnt
docker run \
-v "${PWD}":/mnt/:ro \
-v "${HOME}/.cabal/packages":/root/.cache/cabal/packages \
-v "${HOME}/.cabal/store":/root/.local/state/cabal/store \
-v "${PWD}/dist-newstyle":/mnt/dist-newstyle \
--entrypoint=cabal \
ghcr.io/spex-lang/static-build:9.6.6 \
build all --dry-run --project-dir=/mnt
# The last step generates dist-newstyle/cache/plan.json for the cache key.
Expand All @@ -109,7 +107,6 @@ jobs:
-v "${HOME}/.cabal/packages":/root/.cache/cabal/packages \
-v "${HOME}/.cabal/store":/root/.local/state/cabal/store \
-v "${PWD}/dist-newstyle":/mnt/dist-newstyle \
--entrypoint=cabal \
ghcr.io/spex-lang/static-build:9.6.6 \
build all --only-dependencies --project-dir=/mnt

Expand Down Expand Up @@ -146,7 +143,6 @@ jobs:
-v "${HOME}/.cabal/packages":/root/.cache/cabal/packages \
-v "${HOME}/.cabal/store":/root/.local/state/cabal/store \
-v "${PWD}/dist-newstyle":/mnt/dist-newstyle \
--entrypoint=cabal \
ghcr.io/spex-lang/static-build:9.6.6 \
build exe:spex exe:spex-demo-petstore --enable-executable-static --project-dir=/mnt

Expand Down
11 changes: 5 additions & 6 deletions release/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ ARG CABAL_VERSION

COPY --from=build /root/.ghcup /root/.ghcup

ENV PATH="/root/.ghcup/bin:$PATH"

# Install system dependencies for cabal (curl), ghc (gmp and ncurses) and spex.
RUN apk upgrade --no-cache \
&& apk add --no-cache \
Expand All @@ -93,10 +95,7 @@ RUN apk upgrade --no-cache \
musl-dev \
ncurses-dev \
zlib-dev \
zlib-static

ENV PATH="/root/.ghcup/bin:$PATH"

COPY --chmod=0755 entrypoint.sh /entrypoint.sh
zlib-static \
&& cabal update hackage.haskell.org,2024-10-21T00:00:00Z

ENTRYPOINT [ "/entrypoint.sh" ]
ENTRYPOINT [ "cabal" ]
2 changes: 1 addition & 1 deletion release/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ build-image: Dockerfile
docker build --tag ghcr.io/spex-lang/static-build:$(GHC_VERSION) .

push-image: build-image
@echo ${GITHUB_TOKEN} | \
@echo ${CR_PAT} | \
docker login ghrc.io --username spex-lang --password-stdin
docker push ghcr.io/spex-lang/static-build:$(GHC_VERSION)

Expand Down

0 comments on commit 7b85f3d

Please sign in to comment.