Commit graph

32 commits

Author SHA1 Message Date
Ondřej Budai
e8ae7e7cae .github: switch to ubuntu-20.04
As the team obsessed with immutable test dependencies, how could we use
the ubuntu-latest VM which can change at any time?

Speaking of changes to ubuntu-latest... It will soon be updated from ubuntu
18.04 to 20.04 [1].

This commit switches our testing pipeline to use ubuntu-20.04 to:

1) make our test dependencies immutable (or at least slightly more immutable)
2) make us prepared for the ubuntu-latest changes.

[1]: https://github.com/actions/virtual-environments/issues/1816

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2020-11-19 11:58:56 +01:00
Lars Karlitski
f3b56cc305 master → main 2020-11-13 14:09:01 +01:00
Ondřej Budai
3bcce32c9b .github: add rpmlint
rpmlint errors are usually not a big deal but it's always nice when we can
catch them early. This commit introduces a new Github workflow that builds
an SRPM and runs rpmlint against it.
2020-11-12 12:57:53 +01:00
Ondřej Budai
073f9dc79a test/koji: move the koji test to schutzbot
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.
2020-11-02 19:59:28 +01:00
Alexander Todorov
d5a22097b8 tests: Add notes for downstream testing
also includes PR template to make this more visible to
everyone!
2020-10-15 19:01:47 +01:00
Tom Gundersen
555934e303 koji: move run-koji-containers.sh to tools
Also install it is part of he tests subpackage. This a helper-tool, not
golang code, so should not live in `internal`. We need access to this
from the integration tests, so install it onto the tests system.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-10-06 13:08:26 +02:00
Martin Sehnoutka
369d5d3e4d GH workflow: introduce shellcheck job
This job uses shellcheck to analyze all our bash scripts except for
those in /vendor directory.

It also allows sourcing /etc/os-release without checking it, because
it doesn't make any sense to check that the CI machine has correct
/etc/os-release file. Also allow useless cats because I don't think they
cause any harm.
2020-09-19 15:10:39 +02:00
Tom Gundersen
4f39a33d34 osbuild-composer-koji.socket: use standard https port
Rather than using the arbitrary port 8701, use the standard 443. The
worker API will remain on a separate port, and as long as the two APIs
are exposed by the same binary that will have to remain separate at
8700.

Move the test instance of koji on localhost from 443 to 4343, to avoid a
conflict.

In a follow-up we should also give this API a prefix, so the cloud API
can share the same port with it.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-09-17 17:34:57 +02:00
Tom Gundersen
e52830f530 upload/koji: don't pass task_id to cg_init_build
Contrary to our assumption, we cannot initialize the build with the
link to the task. We can only update the link once the build has
completed.

This seems like a bug in koji, but we keep it like this for now.
2020-09-16 00:15:02 +01:00
Ondřej Budai
05fd221bd4 upload/koji: add support for GSSAPI/Kerberos auth
Prior this commit we only had support for username/password authentication
in the koji integration. This wasn't particularly useful because this
auth type isn't used in any production instance.

This commit adds the support for GSSAPI/Kerberos authentication.
The implementation uses kerby library which is very lightweight wrapper
around C gssapi library.

Also, the koji unit test and the run-koji-container script were modified
so the GSSAPI auth is fully tested.
2020-08-27 17:29:57 +01:00
Ondřej Budai
a6b33e394b ci/koji: use the same container setup as for local testing
Services in Github Actions are cool but have some drawbacks:
1) We want to be able to use the container setup locally, therefore there's
   run-koji-container script which does exactly the same setup as it's defined
   in Github Actions. We don't want duplicities though.

2) In the near future, we will need more complicated setup - generating
   certificates before a container is started. This is not possible with
   the current Github Actions capabilities.

This commit removes the container setup from Github Actions and just reuses
the run-koji-container script in the GH Actions environment. This way we
have only one setup which is also more flexible.
2020-08-27 17:29:57 +01:00
Ondřej Budai
b525cee26e ci: bump golangci-lint version 2020-08-25 10:42:54 +02:00
Ondřej Budai
5e6e77b565 bump minimal Go version to 1.13
All our downstream platforms now support Go 1.13:

RHEL 8.2: golang-1.13.4
Fedora 31: golang-1.13.14

There's no reason anymore to stay on 1.12, therefore this commit bumps
the minimal required Go version to 1.13
2020-08-25 10:42:21 +02:00
Major Hayden
01c8daabf7 ⏱ Extend golangci-lint timeout to 5m0s
For reasons unknown, golangci-lint's default 1m0s timeout is *slightly*
too short for CI runs occasionally. Extend it to 5 minutes to ensure the
job always has enough time to run.

Signed-off-by: Major Hayden <major@redhat.com>
2020-08-24 12:21:38 -05:00
Major Hayden
ac11ea00f0 Remove RPM builds in GitHub Workflows
We are now building RPMs via mock in Jenkins, so we don't need these RPM
build jobs in GitHub Workflows.

Signed-off-by: Major Hayden <major@redhat.com>
2020-05-22 07:44:44 -05:00
Brian C. Lane
3c312b9bbd github: Fix go test coverage report
The go test coverage report does not cover other packages unless you
list them with the -coverpkg= argument. This results in an incomplete
coverage report with oddly missing lines.

This commit lists all of the packages so that they will all be included
when running the tests and gathering the results.
2020-05-20 22:58:29 +02:00
Ondřej Budai
4ebf6ee85b upload/koji: add a simple test
This commit adds a test which uploads a random file to Koji and runs CGImport.
The result is checked using the koji cli client.
2020-05-19 13:54:53 +02:00
Ondřej Budai
f21e86cd8c workflow: enable updates-testing repo when installing osbuild on f31
This is the same fix as in 7ff15e1f, but for the old package (and therefore
for f31).

Copy of the 7ff15e1f commit message:

The source of issue here is that our release cycles are synchronized and
if we want to use the latest released osbuild we need to wait for the
bodhi process. It makes sense that we don't want to use latest osbuild
from git master but we should be confident enough in the version we
submit to bodhi.

Using the version from updates-testing therefore fixes the issue with
synchronization and avoids using unreleased versions.
2020-04-24 15:27:39 +02:00
Martin Sehnoutka
ebeecfaf33 github/workflows: downgrade golang to 1.12
We currently declare compatibility with golang 1.12 so we should also
use it in our CI. Once we agree that we would benefit from some features
in golang 1.13 or 1.14 we can bump it back.
2020-04-15 10:34:32 +02:00
Martin Sehnoutka
7ff15e1fc2 workflow: enable updates-testing repo when installing osbuild
The source of issue here is that our release cycles are synchronized and
if we want to use the latest released osbuild we need to wait for the
bodhi process. It makes sense that we don't want to use latest osbuild
from git master but we should be confident enough in the version we
submit to bodhi.

Using the version from updates-testing therefore fixes the issue with
synchronization and avoids using unreleased versions.
2020-04-14 19:12:44 +02:00
Major Hayden
f124b8e0e0 📦 Use prepared containers
We added this to osbuild but it was never added to osbuid-composer.

Signed-off-by: Major Hayden <major@redhat.com>
2020-04-07 20:16:58 +02:00
Ondřej Budai
c081844954 ci/github: bump the checkout action to version 2
actions/checkout@v1 sometimes fails, bumping the version should fix it. See:
https://github.com/actions/checkout/issues/23
2020-04-01 15:03:48 +02:00
Lars Karlitski
144570026d .github: switch to codecov.io
coveralls doesn't work from GitHub actions. Its "github" service type
uses the GITHUB_TOKEN from the action, which only has read access when
invoked from a forked repository.

codecov gets this right: it validates that an uploaded coverage file
originated from a GitHub action run by asking GitHub, and then uses its
OAuth credentials (through the Marketplace App) to comment and set
status.

Also, coveralls requires a third-party package to convert go's coverage
report to a format it understands. codecov detects the format
server-side. It also handles go's coverage format better: it highlights
lines with "some coverage" in yellow (coveralls has no concept of this).
2020-03-30 20:43:34 +02:00
Lars Karlitski
57134548a1 .github: run unit tests only once, with coverage
We've been running the unit tests twice, once with and once without
coverage. Run them only once, with coverage.
2020-03-29 16:10:46 +02:00
Ondřej Budai
64181e7ba0 ci/rpm: use the old spec file for f31
Prior this commit the rpm for fedora 31 was built using the new spec file.
The old spec file should be used for that Fedora version.
2020-03-25 11:43:39 +01:00
Ondřej Budai
8873b3d17e ci/source-check: check also the unstaged files
Prior this commit it was possible to pass the CI checks even without added
files in vendor directory, because git diff doesn't check for unstaged
files. This commit fixes it.
2020-03-13 16:00:29 +01:00
Tom Gundersen
e8e5a11389 github-action: run unit tests
There should be no need to run unit tests on specific architectures,
move it over to github-actions and rename "Lint" to "Checks" as it
is a bit more generic now.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-03-10 23:38:03 +01:00
Tom Gundersen
c50aa9e135 github-action: add prepare-source test to linting
This is inspired by PR #307, but uses github actions rather than
Travis.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2020-03-10 23:38:03 +01:00
Brian C. Lane
c5341211e9 Add coveralls.io code coverage github-action
This uses the goveralls package to convert the coverage report to lcov
and send it to coveralls.io
2020-03-09 18:06:08 +01:00
Major Hayden
75dd1db6e3 🐣 Use new 'make rpm' in GitHub Actions
Signed-off-by: Major Hayden <major@redhat.com>
2020-03-05 10:59:53 -06:00
Major Hayden
7af12f6ce6 📦 Add RPM builds via github actions
Unify the github actions workflows under `tests.yml` and add an RPM build
job to match the one for osbuild.

Signed-off-by: Major Hayden <major@redhat.com>
2020-03-03 21:06:04 +01:00
Ondřej Budai
7de9b88a3e ci: add golangci-lint 2020-03-02 14:28:55 +01:00