From 1b24081e345ce62456907db5bf92315d688bf083 Mon Sep 17 00:00:00 2001 From: Victor Gaydov Date: Mon, 14 Nov 2022 14:20:35 +0400 Subject: [PATCH] Rework CI script --- .github/workflows/build.yaml | 49 ++++++++++++++++++++++++++---------- README.md | 2 +- 2 files changed, 37 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index b20563fcc..68b6fb725 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -19,16 +19,12 @@ jobs: strategy: matrix: - include: - - go: 1.17 - coverage: no - - go: 1.x - coverage: yes + go: [1.17, 1.x] name: Go ${{ matrix.go }} steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Install Go uses: actions/setup-go@v3 @@ -39,25 +35,52 @@ jobs: run: go get -v . - name: Run tests - run: go test -covermode=count -coverprofile=coverage.out + run: go test + + - name: Build examples + run: cd _examples && go get -v . + + - name: Run examples tests + run: cd _examples && go test + + linters: + runs-on: ubuntu-latest + + name: Linters + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Install Go + uses: actions/setup-go@v3 + with: + go-version: 1.x - name: Run linters uses: golangci/golangci-lint-action@v3 with: version: v1.50.1 - - name: Build examples - run: cd _examples && go get -v . + coverage: + runs-on: ubuntu-latest - - name: Run examples tests - run: cd _examples && go test + name: Coverage + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Install Go + uses: actions/setup-go@v3 + with: + go-version: 1.x + + - name: Run tests + run: go test -covermode=count -coverprofile=coverage.out - name: Prepare coverage report - if: ${{ matrix.coverage == 'yes' }} uses: jandelgado/gcov2lcov-action@v1.0.5 - name: Send coverage report - if: ${{ matrix.coverage == 'yes' }} uses: coverallsapp/github-action@master with: github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/README.md b/README.md index 8427f67ac..861257dcb 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# httpexpect [![GoDev](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white)](https://pkg.go.dev/github.com/gavv/httpexpect/v2) [![Build](https://github.com/gavv/httpexpect/workflows/build/badge.svg)](https://github.com/gavv/httpexpect/actions) [![Coveralls](https://coveralls.io/repos/github/gavv/httpexpect/badge.svg?branch=master)](https://coveralls.io/github/gavv/httpexpect?branch=master) [![GitHub release](https://img.shields.io/github/tag/gavv/httpexpect.svg)](https://github.com/gavv/httpexpect/releases) +# httpexpect [![GoDev](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white)](https://pkg.go.dev/github.com/gavv/httpexpect/v2) [![Build](https://github.com/gavv/httpexpect/workflows/build/badge.svg)](https://github.com/gavv/httpexpect/actions) [![Coveralls](https://coveralls.io/repos/github/gavv/httpexpect/badge.svg?branch=master)](https://coveralls.io/github/gavv/httpexpect?branch=master) [![GitHub release](https://img.shields.io/github/tag/gavv/httpexpect.svg)](https://github.com/gavv/httpexpect/tags) Concise, declarative, and easy to use end-to-end HTTP and REST API testing for Go (golang).