Skip to content

Commit 655c1cf

Browse files
committed
👷 Update the CI pipeline to support more versions
1 parent 647659c commit 655c1cf

File tree

7 files changed

+95
-84
lines changed

7 files changed

+95
-84
lines changed

.github/workflows/continous-integration.yml

Lines changed: 23 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -11,46 +11,39 @@ on:
1111
- 'README.md'
1212

1313
env:
14-
VIPS_VERSIONS: |
15-
["8.10.6", "8.11.4", "8.12.2", "8.13.3", "8.14.5", "8.15.5", "8.16.0"]
14+
GOLANGCILINT_VERSION: "1.63.4"
1615

1716
jobs:
18-
prepareTestContainer:
19-
name: Prepare test containers
20-
runs-on: ubuntu-latest
21-
outputs:
22-
versions: ${{ steps.build.outputs.versions }}
23-
steps:
24-
- name: Checkout
25-
uses: actions/checkout@v2
26-
- name: Cache Docker layers
27-
uses: satackey/[email protected]
28-
continue-on-error: true
29-
with:
30-
key: testcontainers-${{ hashFiles('Dockerfile') }}
31-
- name: Build
32-
id: build
33-
run: |
34-
echo ${VIPS_VERSIONS} | jq -c -r ".[]" | while read version; do
35-
echo "Building for VIPS $version"
36-
docker build --build-arg VIPS_VERSION=$version -t h2non/bimg:ci-$version . || exit 1
37-
done
38-
echo ::set-output name=versions::${VIPS_VERSIONS}
39-
4017
test:
4118
name: Test
4219
runs-on: ubuntu-latest
43-
needs: [ prepareTestContainer ]
4420
strategy:
4521
matrix:
46-
libvips: ${{ fromJSON(needs.prepareTestContainer.outputs.versions) }}
22+
container-with-vips: [
23+
"alpine3-14.vips8-10-6",
24+
"alpine3-16.vips8-12-2",
25+
"alpine3-17.vips8-13-3",
26+
"alpine3-18.vips8-14-3",
27+
"alpine3-21.vips8-15-3"
28+
]
4729
fail-fast: false
4830
steps:
4931
- name: Checkout
5032
uses: actions/checkout@v2
51-
- name: Cache Docker layers
52-
uses: satackey/[email protected]
33+
34+
- name: Set up Docker Buildx
35+
uses: docker/setup-buildx-action@v3
36+
37+
- name: Build and export to Docker
38+
uses: docker/build-push-action@v6
5339
with:
54-
key: testcontainers-${{ hashFiles('Dockerfile') }}
40+
cache-from: type=gha
41+
cache-to: type=gha,mode=max`
42+
load: true
43+
build-args: |
44+
GOLANGCILINT_VERSION=${{ env.GOLANGCILINT_VERSION }}
45+
tags: h2non/bimg:ci-${{ matrix.container-with-vips }}
46+
5547
- name: Run tests
56-
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'
48+
run: |
49+
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'

Dockerfile

Lines changed: 0 additions & 54 deletions
This file was deleted.

Dockerfile.alpine3-14.vips8-10-6

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
FROM alpine:3.14
2+
LABEL org.opencontainers.image.authors="[email protected]"
3+
4+
RUN apk add --no-cache \
5+
curl \
6+
build-base \
7+
go \
8+
vips-dev
9+
10+
ARG GOLANGCILINT_VERSION=1.63.4
11+
RUN curl -fsSL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b /usr/bin v${GOLANGCILINT_VERSION}

Dockerfile.alpine3-16.vips8-12-2

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM alpine:3.16
2+
LABEL org.opencontainers.image.authors="[email protected]"
3+
4+
RUN apk add --no-cache \
5+
curl \
6+
build-base \
7+
go \
8+
vips-dev \
9+
vips-magick \
10+
vips-poppler
11+
12+
ARG GOLANGCILINT_VERSION=1.63.4
13+
RUN curl -fsSL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b /usr/bin v${GOLANGCILINT_VERSION}

Dockerfile.alpine3-17.vips8-13-3

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
FROM alpine:3.17
2+
LABEL org.opencontainers.image.authors="[email protected]"
3+
4+
RUN apk add --no-cache \
5+
curl \
6+
build-base \
7+
go \
8+
vips-dev \
9+
vips-cpp \
10+
vips-magick \
11+
vips-poppler \
12+
vips-heif \
13+
vips-jxl
14+
15+
ARG GOLANGCILINT_VERSION=1.63.4
16+
RUN curl -fsSL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b /usr/bin v${GOLANGCILINT_VERSION}

Dockerfile.alpine3-18.vips8-14-3

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
FROM alpine:3.18
2+
LABEL org.opencontainers.image.authors="[email protected]"
3+
4+
RUN apk add --no-cache \
5+
curl \
6+
build-base \
7+
go \
8+
vips-dev \
9+
vips-cpp \
10+
vips-magick \
11+
vips-poppler \
12+
vips-heif \
13+
vips-jxl
14+
15+
ARG GOLANGCILINT_VERSION=1.63.4
16+
RUN curl -fsSL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b /usr/bin v${GOLANGCILINT_VERSION}

Dockerfile.alpine3-21.vips8-15-3

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
FROM alpine:3.21
2+
LABEL org.opencontainers.image.authors="[email protected]"
3+
4+
RUN apk add --no-cache \
5+
curl \
6+
build-base \
7+
go \
8+
vips-dev \
9+
vips-cpp \
10+
vips-magick \
11+
vips-poppler \
12+
vips-heif \
13+
vips-jxl
14+
15+
ARG GOLANGCILINT_VERSION=1.63.4
16+
RUN curl -fsSL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b /usr/bin v${GOLANGCILINT_VERSION}

0 commit comments

Comments
 (0)