debian-forge-composer/.github/workflows/tests.yml
dependabot[bot] 87bbe51e03 build(deps): bump actions/checkout from 2.3.4 to 2.4.0
Bumps [actions/checkout](https://github.com/actions/checkout) from 2.3.4 to 2.4.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2.3.4...v2.4.0)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-12-22 13:56:15 +01:00

88 lines
2.5 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:
- main
jobs:
lint:
name: "🛃 Checks"
runs-on: ubuntu-20.04
steps:
- name: Set up Go 1.15
uses: actions/setup-go@v2.1.4
with:
go-version: 1.15
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: 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 -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
steps:
- uses: actions/checkout@v2.4.0
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@1.1.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
rpmlint:
name: "📦 RPMlint"
runs-on: ubuntu-20.04
container: registry.fedoraproject.org/fedora:35
steps:
- name: Install dependencies
run: sudo dnf install -y rpmlint rpm-build make git-core
- uses: actions/checkout@v2.4.0
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Create SRPM
run: make srpm
- name: Run rpmlint
run: rpmlint rpmbuild/SRPMS/*