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