The Koji test in Github actions was always a bit quick and dirty solution. I think it's much nicer solution to run it on Schutzbot. Therefore, this commit moves the koji_test.go to a new osbuild-koji-tests executable. This new test isn't run in the base test suite as one would anticipate but inside the koji.sh test. This is needed because osbuild-koji-tests requires a running koji instance. This might change in the future but I think it works for now.
66 lines
1.9 KiB
YAML
66 lines
1.9 KiB
YAML
name: Tests
|
|
|
|
# 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:
|
|
lint:
|
|
name: "🛃 Checks"
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
|
|
- name: Set up Go 1.13
|
|
uses: actions/setup-go@v1
|
|
with:
|
|
go-version: 1.13
|
|
id: go
|
|
|
|
- name: Check out code into the Go module directory
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Check that source has been prepared
|
|
run: |
|
|
./tools/prepare-source.sh
|
|
if [ -n "$(git status --porcelain)" ]; then
|
|
echo
|
|
echo "Please include these changes in your branch: "
|
|
git status -vv
|
|
exit "1"
|
|
else
|
|
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 -v -race -covermode=atomic -coverprofile=coverage.txt -coverpkg=./... ./...
|
|
|
|
- name: Send coverage to codecov.io
|
|
run: bash <(curl -s https://codecov.io/bash)
|
|
|
|
shellcheck:
|
|
name: "🐚 Shellcheck"
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Run ShellCheck
|
|
uses: ludeeus/action-shellcheck@0.5.0
|
|
with:
|
|
ignore: vendor # We don't want to fix the code in vendored dependencies
|
|
env:
|
|
SHELLCHECK_OPTS: -e SC1091 -e SC2002 # don't check /etc/os-release sourcing and allow useless cats to live inside our codebase
|