From 9418e4e2de8bf60b42fb79c90b04534aa59459aa Mon Sep 17 00:00:00 2001 From: Toni Melisma <59022391+tonimelisma@users.noreply.github.com> Date: Tue, 10 Nov 2020 22:52:06 +0200 Subject: [PATCH] Enable github CI --- .github/workflows/build.yml | 50 +++++++++++++++++++++++++++++++++++++ .travis.yml | 28 --------------------- README.md | 2 +- 3 files changed, 51 insertions(+), 29 deletions(-) create mode 100644 .github/workflows/build.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..478ec8fd --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,50 @@ +name: build + +on: [ push, pull_request ] + +jobs: + build: + name: Build + runs-on: ${{ matrix.os }} + env: + CGO_CFLAGS_ALLOW: -Xpreprocessor + strategy: + matrix: + os: [ubuntu-18.04, ubuntu-20.04, macOS-10.15, macos-11.0] + + steps: + + - name: Set up Go 1.x + uses: actions/setup-go@v2 + with: + go-version: ^1.13 + + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + + - name: Install linux deps + if: matrix.os == 'ubuntu-18.04' || matrix.os == 'ubuntu-20.04' + run: | + sudo add-apt-repository -y ppa:tonimelisma/ppa + sudo apt-get -y install libvips-dev + + - name: Install macos deps + if: matrix.os == 'macos-10.15' || matrix.os == 'macos-11.0' + run: | + brew install vips + + - name: Get dependencies + run: | + go get -v -t -d ./... + + - name: Build + run: go build -v ./vips + + - name: Test + run: go test -v -coverprofile=profile.cov ./... + + - name: Coveralls + if: matrix.os == 'ubuntu-20.04' + uses: shogo82148/actions-goveralls@v1 + with: + path-to-profile: profile.cov \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 892d5097..00000000 --- a/.travis.yml +++ /dev/null @@ -1,28 +0,0 @@ -language: go - -go: - - 1.15.x - -env: - - CGO_CFLAGS_ALLOW="-Xpreprocessor" - -matrix: - include: - - os: osx - osx_image: xcode12.2 - - - os: linux - dist: bionic - - - os: linux - dist: focal - -before_install: - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo add-apt-repository -y ppa:tonimelisma/ppa; fi - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get -y install libvips-dev; fi - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install vips; fi - - go get github.com/mattn/goveralls - -script: - - make test - - $GOPATH/bin/goveralls -service=travis-ci diff --git a/README.md b/README.md index b0dc6d67..72a53fdd 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# govips [![GoDoc](https://godoc.org/github.com/davidbyttow/govips?status.svg)](https://pkg.go.dev/mod/github.com/davidbyttow/govips/v2) [![Go Report Card](http://goreportcard.com/badge/davidbyttow/govips)](http://goreportcard.com/report/davidbyttow/govips) ![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/davidbyttow/govips) ![License](https://img.shields.io/badge/license-MIT-blue.svg) [![Build Status](https://travis-ci.org/davidbyttow/govips.svg?branch=master)](https://travis-ci.org/davidbyttow/govips) [![Coverage Status](https://img.shields.io/coveralls/github/davidbyttow/govips)](https://coveralls.io/github/davidbyttow/govips?branch=master) +# govips [![GoDoc](https://godoc.org/github.com/davidbyttow/govips?status.svg)](https://pkg.go.dev/mod/github.com/davidbyttow/govips/v2) [![Go Report Card](http://goreportcard.com/badge/davidbyttow/govips)](http://goreportcard.com/report/davidbyttow/govips) ![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/davidbyttow/govips) ![License](https://img.shields.io/badge/license-MIT-blue.svg) [![Build Status](https://github.com/davidbyttow/govips/workflows/build/badge.svg)](https://github.com/davidbyttow/govips/actions) [![Coverage Status](https://img.shields.io/coveralls/github/davidbyttow/govips)](https://coveralls.io/github/davidbyttow/govips?branch=master) ## A lightning fast image processing and resizing library for Go