Skip to content

Commit

Permalink
👷 Update the CI pipeline to support more versions
Browse files Browse the repository at this point in the history
  • Loading branch information
aksdb committed Jan 22, 2025
1 parent 647659c commit 655c1cf
Show file tree
Hide file tree
Showing 7 changed files with 95 additions and 84 deletions.
53 changes: 23 additions & 30 deletions .github/workflows/continous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,46 +11,39 @@ on:
- 'README.md'

env:
VIPS_VERSIONS: |
["8.10.6", "8.11.4", "8.12.2", "8.13.3", "8.14.5", "8.15.5", "8.16.0"]
GOLANGCILINT_VERSION: "1.63.4"

jobs:
prepareTestContainer:
name: Prepare test containers
runs-on: ubuntu-latest
outputs:
versions: ${{ steps.build.outputs.versions }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Cache Docker layers
uses: satackey/[email protected]
continue-on-error: true
with:
key: testcontainers-${{ hashFiles('Dockerfile') }}
- name: Build
id: build
run: |
echo ${VIPS_VERSIONS} | jq -c -r ".[]" | while read version; do
echo "Building for VIPS $version"
docker build --build-arg VIPS_VERSION=$version -t h2non/bimg:ci-$version . || exit 1
done
echo ::set-output name=versions::${VIPS_VERSIONS}
test:
name: Test
runs-on: ubuntu-latest
needs: [ prepareTestContainer ]
strategy:
matrix:
libvips: ${{ fromJSON(needs.prepareTestContainer.outputs.versions) }}
container-with-vips: [
"alpine3-14.vips8-10-6",
"alpine3-16.vips8-12-2",
"alpine3-17.vips8-13-3",
"alpine3-18.vips8-14-3",
"alpine3-21.vips8-15-3"
]
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Cache Docker layers
uses: satackey/[email protected]

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

- name: Build and export to Docker
uses: docker/build-push-action@v6
with:
key: testcontainers-${{ hashFiles('Dockerfile') }}
cache-from: type=gha
cache-to: type=gha,mode=max`
load: true
build-args: |
GOLANGCILINT_VERSION=${{ env.GOLANGCILINT_VERSION }}
tags: h2non/bimg:ci-${{ matrix.container-with-vips }}

- name: Run tests
run: docker run --rm -v $PWD:/build h2non/bimg:ci-${{ matrix.libvips }} sh -c 'cd /build && go vet . && golangci-lint run && go test -v -race -covermode=atomic -coverprofile=coverage.out'
run: |
docker run --rm -v $PWD:/build h2non/bimg:ci-${{ matrix.container-with-vips }} sh -c 'cd /build && go vet . && golangci-lint run && go test -v -race -covermode=atomic -coverprofile=coverage.out'
54 changes: 0 additions & 54 deletions Dockerfile

This file was deleted.

11 changes: 11 additions & 0 deletions Dockerfile.alpine3-14.vips8-10-6
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM alpine:3.14
LABEL org.opencontainers.image.authors="[email protected]"

RUN apk add --no-cache \
curl \
build-base \
go \
vips-dev

ARG GOLANGCILINT_VERSION=1.63.4
RUN curl -fsSL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b /usr/bin v${GOLANGCILINT_VERSION}
13 changes: 13 additions & 0 deletions Dockerfile.alpine3-16.vips8-12-2
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM alpine:3.16
LABEL org.opencontainers.image.authors="[email protected]"

RUN apk add --no-cache \
curl \
build-base \
go \
vips-dev \
vips-magick \
vips-poppler

ARG GOLANGCILINT_VERSION=1.63.4
RUN curl -fsSL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b /usr/bin v${GOLANGCILINT_VERSION}
16 changes: 16 additions & 0 deletions Dockerfile.alpine3-17.vips8-13-3
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM alpine:3.17
LABEL org.opencontainers.image.authors="[email protected]"

RUN apk add --no-cache \
curl \
build-base \
go \
vips-dev \
vips-cpp \
vips-magick \
vips-poppler \
vips-heif \
vips-jxl

ARG GOLANGCILINT_VERSION=1.63.4
RUN curl -fsSL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b /usr/bin v${GOLANGCILINT_VERSION}
16 changes: 16 additions & 0 deletions Dockerfile.alpine3-18.vips8-14-3
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM alpine:3.18
LABEL org.opencontainers.image.authors="[email protected]"

RUN apk add --no-cache \
curl \
build-base \
go \
vips-dev \
vips-cpp \
vips-magick \
vips-poppler \
vips-heif \
vips-jxl

ARG GOLANGCILINT_VERSION=1.63.4
RUN curl -fsSL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b /usr/bin v${GOLANGCILINT_VERSION}
16 changes: 16 additions & 0 deletions Dockerfile.alpine3-21.vips8-15-3
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM alpine:3.21
LABEL org.opencontainers.image.authors="[email protected]"

RUN apk add --no-cache \
curl \
build-base \
go \
vips-dev \
vips-cpp \
vips-magick \
vips-poppler \
vips-heif \
vips-jxl

ARG GOLANGCILINT_VERSION=1.63.4
RUN curl -fsSL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b /usr/bin v${GOLANGCILINT_VERSION}

0 comments on commit 655c1cf

Please sign in to comment.