.github: run unit tests only once, with coverage
We've been running the unit tests twice, once with and once without coverage. Run them only once, with coverage.
This commit is contained in:
parent
2575b611e4
commit
57134548a1
2 changed files with 9 additions and 36 deletions
35
.github/workflows/coverage.yml
vendored
35
.github/workflows/coverage.yml
vendored
|
|
@ -1,35 +0,0 @@
|
|||
name: Coverage
|
||||
|
||||
# NOTE(mhayden): Restricting branches prevents jobs from being doubled since
|
||||
# a push to a pull request triggers two events.
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- "*"
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: Test with Coverage
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v1
|
||||
with:
|
||||
go-version: '1.13'
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v2
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
go mod download
|
||||
- name: Run Unit tests
|
||||
run: |
|
||||
go test -race -covermode atomic -coverprofile=profile.cov ./...
|
||||
- name: Send coverage
|
||||
env:
|
||||
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
GO111MODULE=off go get github.com/mattn/goveralls
|
||||
$(go env GOPATH)/bin/goveralls -coverprofile=profile.cov -service=github
|
||||
10
.github/workflows/tests.yml
vendored
10
.github/workflows/tests.yml
vendored
|
|
@ -40,11 +40,19 @@ jobs:
|
|||
- name: Install golangci-lint
|
||||
run: curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $(go env GOPATH)/bin v1.23.7
|
||||
|
||||
- name: Install goveralls
|
||||
run: GO111MODULE=off go get github.com/mattn/goveralls
|
||||
|
||||
- name: Run golangci-lint
|
||||
run: $(go env GOPATH)/bin/golangci-lint run
|
||||
|
||||
- name: Run unit tests
|
||||
run: go test -v ./...
|
||||
run: go test -v -race -covermode atomic -coverprofile=profile.cov ./...
|
||||
|
||||
- name: Send coverage to coveralls.io
|
||||
env:
|
||||
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: $(go env GOPATH)/bin/goveralls -coverprofile=profile.cov -service=github
|
||||
|
||||
old_rpm_build:
|
||||
name: "📦 RPM (golang-github-osbuild-composer)"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue