github: split checks into 3 jobs
To speed it up a bit. Signed-off-by: Ondřej Budai <ondrej@budai.cz>
This commit is contained in:
parent
d492e8f702
commit
11893485cd
1 changed files with 53 additions and 17 deletions
70
.github/workflows/tests.yml
vendored
70
.github/workflows/tests.yml
vendored
|
|
@ -12,7 +12,59 @@ on:
|
|||
|
||||
jobs:
|
||||
lint:
|
||||
name: "🛃 Checks"
|
||||
name: "🛃 Unit tests"
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
|
||||
- name: Set up Go 1.16
|
||||
uses: actions/setup-go@v2.1.5
|
||||
with:
|
||||
go-version: 1.16
|
||||
id: go
|
||||
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v2.4.0
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
|
||||
# This is needed to test internal/upload/koji package
|
||||
- name: Install kerberos devel package
|
||||
run: sudo apt-get install -y libkrb5-dev
|
||||
|
||||
- name: Run unit tests
|
||||
run: go test -race -covermode=atomic -coverprofile=coverage.txt -coverpkg=$(go list ./... | grep -v rpmmd/test$ | tr "\n" ",") ./...
|
||||
|
||||
- name: Send coverage to codecov.io
|
||||
run: bash <(curl -s https://codecov.io/bash)
|
||||
|
||||
unit-tests:
|
||||
name: "⌨ Lint"
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
|
||||
- name: Set up Go 1.16
|
||||
uses: actions/setup-go@v2.1.5
|
||||
with:
|
||||
go-version: 1.16
|
||||
id: go
|
||||
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v2.4.0
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
|
||||
- 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.30.0
|
||||
|
||||
# This is needed to lint internal/upload/koji package
|
||||
- name: Install kerberos devel package
|
||||
run: sudo apt-get install -y libkrb5-dev
|
||||
|
||||
- name: Run golangci-lint
|
||||
run: $(go env GOPATH)/bin/golangci-lint run --timeout 5m0s
|
||||
|
||||
prepare:
|
||||
name: "🔍 Check source preparation"
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
|
||||
|
|
@ -39,22 +91,6 @@ jobs:
|
|||
exit "0"
|
||||
fi
|
||||
|
||||
- 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.30.0
|
||||
|
||||
# This is needed to lint internal/upload/koji package
|
||||
- name: Install kerberos devel package
|
||||
run: sudo apt-get install -y libkrb5-dev
|
||||
|
||||
- name: Run golangci-lint
|
||||
run: $(go env GOPATH)/bin/golangci-lint run --timeout 5m0s
|
||||
|
||||
- name: Run unit tests
|
||||
run: go test -race -covermode=atomic -coverprofile=coverage.txt -coverpkg=$(go list ./... | grep -v rpmmd/test$ | tr "\n" ",") ./...
|
||||
|
||||
- name: Send coverage to codecov.io
|
||||
run: bash <(curl -s https://codecov.io/bash)
|
||||
|
||||
shellcheck:
|
||||
name: "🐚 Shellcheck"
|
||||
runs-on: ubuntu-20.04
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue