⬆️ Add tests for newer versions #14
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Continous Integration | |
on: | |
push: | |
branches: | |
- '*' | |
tags: | |
- '*' | |
paths-ignore: | |
- 'History.md' | |
- '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"] | |
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) }} | |
fail-fast: false | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Cache Docker layers | |
uses: satackey/[email protected] | |
with: | |
key: testcontainers-${{ hashFiles('Dockerfile') }} | |
- 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' |