diff --git a/.github/workflows/workflow.yaml b/.github/workflows/workflow.yaml index 76fba22..4ad7587 100644 --- a/.github/workflows/workflow.yaml +++ b/.github/workflows/workflow.yaml @@ -2,7 +2,11 @@ name: Workflow on: push jobs: docker: - name: Docker + strategy: + matrix: + ghc: + - 9.0.2 + name: Docker with GHC ${{ matrix.ghc }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -13,7 +17,9 @@ jobs: with: images: ghcr.io/${{ github.repository }} flavor: latest=false - tags: type=sha,format=long + tags: | + type=sha,format=long,prefix=${{ matrix.ghc }}- + type=raw,value=${{ matrix.ghc }},enable={{ is_default_branch }} - uses: docker/login-action@v2 with: password: ${{ secrets.GITHUB_TOKEN }} @@ -21,6 +27,9 @@ jobs: username: ${{ github.actor }} - uses: docker/build-push-action@v3 with: + build-args: GHC_VERSION=${{ matrix.ghc }} + cache-from: type=gha + cache-to: type=gha,mode=max labels: ${{ steps.meta.outputs.labels }} platforms: linux/amd64,linux/arm64 push: true diff --git a/Dockerfile b/Dockerfile index 9c3437d..5fa1157 100644 --- a/Dockerfile +++ b/Dockerfile @@ -56,6 +56,7 @@ ARG GHC_VERSION=9.0.2 RUN \ set -o errexit -o xtrace; \ ghcup install ghc "$GHC_VERSION" --set; \ + ghcup gc --profiling-libs --share-dir; \ ghc --version # Install Cabal. @@ -80,6 +81,7 @@ ARG HLS_VERSION=1.7.0.0 RUN \ set -o errexit -o xtrace; \ ghcup install hls "$HLS_VERSION" --set; \ + ghcup gc --hls-no-ghc; \ haskell-language-server-wrapper --version # Configure Cabal. diff --git a/README.markdown b/README.markdown new file mode 100644 index 0000000..4165f87 --- /dev/null +++ b/README.markdown @@ -0,0 +1,9 @@ +# docker-haskell + +This Docker image provides a Haskell development environment with the following tools: + +- [GHCup](https://www.haskell.org/ghcup/) +- [GHC](https://www.haskell.org/ghc/) +- [Cabal](https://www.haskell.org/cabal/) +- [Stack](https://docs.haskellstack.org/en/stable/README/) +- [HLS](https://haskell-language-server.readthedocs.io/en/latest/)