From 11893485cd2caa02ddb2cb85876df7dcd671f8d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Budai?= Date: Tue, 15 Feb 2022 21:38:56 +0100 Subject: [PATCH] github: split checks into 3 jobs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit To speed it up a bit. Signed-off-by: OndΕ™ej Budai --- .github/workflows/tests.yml | 70 ++++++++++++++++++++++++++++--------- 1 file changed, 53 insertions(+), 17 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b361c829b..6945c7cc4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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