Skip to content
Merged
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
12 changes: 8 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,29 @@ jobs:
username: fossabot
password: ${{ github.token }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3

- name: Cache Docker layers
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-
restore-keys: |
${{ runner.os }}-buildx-

- name: Build and push image
uses: docker/build-push-action@v2
uses: docker/build-push-action@v6
with:
tags: 'ghcr.io/fossas/haskell-dev-tools:9.8.2'
tags: 'ghcr.io/fossas/haskell-dev-tools:9.8.4'
push: true
context: ./src
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
platforms: linux/amd64,linux/arm64

- # Temp fix
# https://github.com/docker/build-push-action/issues/252
Expand Down
22 changes: 13 additions & 9 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- uses: actions/checkout@v2

Expand All @@ -36,12 +36,12 @@ jobs:

- name: run shellcheck
run: shellcheck **/*.*sh

docker-lint:
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- uses: actions/checkout@v2

Expand All @@ -53,16 +53,19 @@ jobs:
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3

- name: Cache Docker layers
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-
Expand All @@ -72,21 +75,22 @@ jobs:
- name: Get git short hash
id: shorthash
run: |
echo "::set-output name=shorthash::$(git rev-parse --short HEAD)"
echo "::set-output name=shorthash::$(git rev-parse --short HEAD)"

- name: Build and push
uses: docker/build-push-action@v2
uses: docker/build-push-action@v6
with:
context: ./src
push: false
tags: ${{ format('haskell-dev-tools-test:{0}', steps.shorthash.outputs.shorthash) }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
platforms: linux/amd64,linux/arm64

- # Temp fix
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ fossas/fossa-cli repo.

## Changelog

### GHC 9.8.4

- GHC is now version 9.8.4
- cabal-install is now 3.12.1.0
- Multi-platform support: Build images for `linux/amd64` and `linux/arm64`

### GHC 9.8.2

- GHC is now version 9.8.2
Expand Down
15 changes: 4 additions & 11 deletions src/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,16 @@
# Build all tools except hadolint.
FROM fossa/haskell-static-alpine:ghc-9.8.2 AS builder-9.8
FROM fossa/haskell-static-alpine:ghc-9.8.4 AS builder-9.8

# By installing these separately, we prevent the dependecies of one package from conflicting with the others
RUN cabal update && \
cabal install --install-method=copy hlint-3.8 && \
cabal install --install-method=copy fourmolu-0.16.2.0 && \
cabal install --install-method=copy hlint-3.10 && \
cabal install --install-method=copy fourmolu-0.19.0.1 && \
cabal install --install-method=copy cabal-fmt-0.1.12

FROM fossa/haskell-static-alpine:ghc-9.0.2 AS builder-9.0

RUN cabal update && \
cabal install --install-method=copy hadolint-2.12.0

# Copy the built binaries into a smaller image.
FROM fossa/haskell-static-alpine:ghc-9.8.2 AS final
FROM fossa/haskell-static-alpine:ghc-9.8.4 AS final

LABEL org.opencontainers.image.source = "https://github.com/fossas/haskell-dev-tools"

COPY --from=builder-9.8 /root/.local/bin/hlint /root/.cabal/bin/hlint
COPY --from=builder-9.8 /root/.local/bin/fourmolu /root/.cabal/bin/fourmolu
COPY --from=builder-9.8 /root/.local/bin/cabal-fmt /root/.cabal/bin/cabal-fmt
COPY --from=builder-9.0 /root/.local/bin/hadolint /root/.local/bin/hadolint
2 changes: 0 additions & 2 deletions src/update-dev-tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ execute () {
update_package fourmolu "$_tempdir"
log "Updating cabal-fmt"
update_package cabal-fmt "$_tempdir"
log "Updating hadolint"
update_package hadolint "$_tempdir"
# We don't care about the exit code, we just want the diff output
log "Running diff to check for changes"
diff "${dockerfile}.bak" "$dockerfile" || true
Expand Down
Loading