From 7cdad197438d0cd0ab907064dd358a134dae80c1 Mon Sep 17 00:00:00 2001 From: berabulut Date: Mon, 22 Nov 2021 00:59:42 +0300 Subject: [PATCH] Add Github Action Update Github Action Test GH Action Test GH Action Update GH Action Update GH Action Update GH Action Update GH Action Update GH Action Test GH Action Test GH Action Test GH Action Test GH Action Test GH Action Test GH Action Test GH Action Test GH Action Test GH Action Test GH Action Test GH Action Test GH Action Test GH Action Update GH Action Update GH Action Update GH Action Update GH Action --- .github/workflows/test.yml | 56 ++++++++++++++++++++++++++++++++++++++ go.mod | 2 +- 2 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..d6c3e90 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,56 @@ +name: Test + +on: + pull_request: + push: + branches: + - master + +env: + GO111MODULE: on + +jobs: + test: + strategy: + matrix: + go-version: [1.11.13, tip] + fail-fast: false + + runs-on: ubuntu-latest + + steps: + - name: Setup go + run: | + curl -sL https://raw.githubusercontent.com/maxatome/install-go/v3.0/install-go.pl | + perl - ${{ matrix.go-version }} $HOME/go + + - name: Checkout code + uses: actions/checkout@v2 + + - name: Install dependencies + run: | + go get -u github.com/bradleyfalzon/apicompat/cmd/apicompat + go get -u golang.org/x/lint/golint + + - name: Run vet + run: go vet -x ./... + + + - name: Run golint + run: test -z "$(golint ./...)" -e + + - name: Format code + run: test -z "$(gofmt -s -l -w . | tee /dev/stderr)" -e + + - name: Run tests + run: | + go test -v ./... + go test -covermode=count -coverprofile=profile.cov + + - name: Backward compatibility + run: test -z "$(apicompat -before ${{ github.event.before }} -after ${{ github.event.after}} ./... | tee /dev/stderr)" -e + + - name: Send coverage + uses: shogo82148/actions-goveralls@v1 + with: + path-to-profile: profile.cov \ No newline at end of file diff --git a/go.mod b/go.mod index e7fab52..5debf35 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,3 @@ module github.com/ahmetb/go-linq/v3 -go 1.11 +go 1.11 \ No newline at end of file