Commit graph

107 commits

Author SHA1 Message Date
dependabot[bot]
88f863f14b build(deps): bump actions/setup-go from 3 to 4
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 3 to 4.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](https://github.com/actions/setup-go/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-20 10:56:34 +01:00
Antonio Murdaca
e34b88d6e4 .github/workflows: pin golangci-lint to v1.51.0
The new "latest" aka v1.51.1 started throwing unused errors during runs,
blocking all the other tests, to quickly unblock that until a proper
fix/rewrite is found, pin the version to the previous one.

Signed-off-by: Antonio Murdaca <antoniomurdaca@gmail.com>
2023-02-06 11:04:06 +01:00
dependabot[bot]
70c61d4c24 build(deps): bump ludeeus/action-shellcheck
Bumps [ludeeus/action-shellcheck](https://github.com/ludeeus/action-shellcheck) from 6d3f514f44620b9d4488e380339edc0d9bbe2fba to 00cae500b08a931fb5698e11e79bfbd38e612a38.
- [Release notes](https://github.com/ludeeus/action-shellcheck/releases)
- [Commits](6d3f514f44...00cae500b0)

---
updated-dependencies:
- dependency-name: ludeeus/action-shellcheck
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-30 12:26:29 +01:00
Xiaofeng Wang
60e6107b42 Fix workflow shellcheck action deprecated set-output error
Use action-shellcheck@6d3f514f44620b9d4488e380339edc0d9bbe2fba to
have fix included
2023-01-20 15:02:33 +01:00
Ondřej Budai
0359647a82 go.mod: update to Go 1.18
Fedora 35 support was dropped, so we can update to a newer Go.

Stable RHEL 8 and 9 and Fedora 36 ships Go 1.18, so let's switch to it.

"//go:build" directives are now apparently enforced by go fmt, so that's why
there were added.

Also, all the github actions were adjusted to use Go 1.18.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2023-01-09 14:03:18 +01:00
Ondřej Budai
4bafe1ead9 remove Fedora 35 support
Fedora 35 is going EOL on Tue 2022-12-13. At the time of writing this commit
message, that's the next day. As we do releases on Wednesdays, the next
release will never find its way to F35 and thus, there's no point in keeping
support for it.

Let's delete everything that relates to Fedora 35. If there's something that
cannot be deleted (e.g. CI containers based on F35), let's upgrade it to F37.

TestCrossArchDepsolve now uses CentOS Stream 8 because RHEL 8.4 cannot read
F37 repository metadata. This is a similar issue to
https://bugzilla.redhat.com/show_bug.cgi?id=2004853 . Basically, newer
repositories can be only read by libmodulemd >= 2.11.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2023-01-06 11:34:50 +01:00
Ondřej Budai
8c4689f082 workflows: mark the working directory safe for git
Github actions have a peculiar behaviour: The "job root" directory is owned
by user with ID 1001 whereas many containers (like the Fedora one) run as root
by default. This causes git to freak out because repositories owned by
different users aren't considered safe anymore and must be explicitly allow-
listed.

This becomes a problem when we switch to Go 1.18 because it stamps build with
Git information which fails because the repository technically isn't safe.

Let's fix this by marking the repository as a safe one.

Note that the actions/checkout action has a set-safe-directory feature, but
this one is not permanent. After the action is done, the setting is removed.
See https://github.com/actions/checkout/pull/762

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2023-01-06 11:34:50 +01:00
Sanne Raymaekers
07a8f3d5ea test: adapt to shellcheck v0.9.0 2022-12-13 13:55:53 +01:00
Brian C. Lane
87b5e38c45 workflows: Update to use actions/checkout@v3 2022-12-07 16:53:25 -08:00
Brian C. Lane
d73171fdde Use go install instead of deprecated go get
In go 1.18 'go install' needs to be used to install an executable. See
https://go.dev/doc/go-get-install-deprecation and
https://go.dev/doc/manage-install
2022-11-09 12:08:43 +01:00
Brian C. Lane
29fb97f3d6 workflow: Use latest golangci-lint workflow action 2022-09-15 03:57:40 -07:00
Tomas Hozza
31b1a383f0 tools/koji-compose.py: test with pylint and fix found issues
Check `tools/koji-compose.py` using pylint as part of GitHub actions.
Fix all issues that were found by pylint.
2022-08-04 11:55:43 +02:00
Christian Kellner
4b67e12958 ci: install gpgme-devel for db test
This prepares the usage of the `internal/container` from composer
directly, as opposed to the existing use in the worker. Said pkg
uses the `containers/image/v5`, which uses `proglottis/gpgme` and
the latter needs the gpgme C library. We therefore install it and
its dependencies.
2022-07-21 13:32:07 +02:00
Ondřej Budai
30a1f6a68f github: fix the coverity scan action
It was failing on:

vendor/github.com/proglottis/gpgme/data.go:4:11: fatal error: gpgme.h: No such file or directory

Let's install this package before running the check, I verified that this
fix works locally.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2022-07-18 11:19:21 +02:00
dependabot[bot]
2285a0a03b build(deps): bump actions/setup-go from 2 to 3
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 2 to 3.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](https://github.com/actions/setup-go/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-16 19:15:06 +02:00
Sanne Raymaekers
d329af12a1 .github/workflows: Add DB tests 2022-07-04 15:37:28 +02:00
Christian Kellner
986f076276 container: add support for uploading to registries
Add a new generic container registry client via a new `container`
package. Use this to create a command line utility as well as a
new upload target for container registries.

The code uses the github.com/containers/* project and packages to
interact with container registires that is also used by skopeo,
podman et al. One if the dependencies is `proglottis/gpgme` that
is using cgo to bind libgpgme, so we have to add the corresponding
devel package to the BuildRequires as well as installing it on CI.

Checks will follow later via an integration test.
2022-06-29 10:02:46 +02:00
Simon Steinbeiss
f7c735231d Adjust release schedule timer
Adjust the timer for our automated releases to trigger the workflow at
8 UTC. This corresponds to 10am in most of our team's timezone and to
  the reminder event in our team calendar.
2022-06-14 11:21:52 +02:00
Achilleas Koutsou
8070321169 github: run unit tests on Fedora and force dnf
Run unit tests in GitHub workflows in a Fedora container to enable the
dnf-json tests.  Run the tests alone with the `force-dnf` flag to make
sure the tests pass and are not skipped.

Install Go using dnf instead of the GH action.  The action seems to
cause issues with the $PATH.

Use the registry.fedoraproject.org container for both unit tests and
pylint on dnf-json.
Requires some reordering of the steps in each workflow and the addition
of `git-core` as a dependency.

Using Fedora 35 instead of latest because of changes in the go build
tool: The new -buildvcs flag causes issues on GitHub actions.
2022-06-01 11:36:52 +01:00
Achilleas Koutsou
387b982a79 github: fix indentation in workflows/tests 2022-06-01 11:36:52 +01:00
Sanne Raymaekers
2208cb1122 .github: Add kube-linter check 2022-05-27 15:09:42 +02:00
Ondřej Budai
056e095419 github: pin fedora:35 for the pylint check
Fedora 36 ships pylint 2.13 that newly reports:

dnf-json:436:20: E0601: Using variable 'cache_state' before assignment (used-before-assignment)

As dnf-json is pending a big rewrite
(https://github.com/osbuild/osbuild-composer/pull/2537),
I decided to pin fedora to 35 and let the other PR decide how to proceed in
order to prevent any conflicts.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2022-05-13 12:03:26 +02:00
Jakub Rusz
d388d30ef2 rpmplint: trust osbuild-composer repository
Git v2.35.2 brought some security fixes which prevents interaction with
repository if it's not owned by the user who cloned it. More info here:
https://github.blog/2022-04-12-git-security-vulnerability-announced/
2022-05-10 13:25:01 +02:00
Jakub Rusz
717f28adfb workflows/trigger-gitlab: run Gitlab CI in new image-builder project
We have a new project in Gitlab
https://gitlab.com/redhat/services/products/image-builder/ci/osbuild-composer
and we want to run the CI there instead.
2022-04-14 21:45:07 +02:00
dependabot[bot]
f3141d2d71 build(deps): bump actions/setup-go from 2.1.5 to 3
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 2.1.5 to 3.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](https://github.com/actions/setup-go/compare/v2.1.5...v3)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-06 08:57:31 +02:00
dependabot[bot]
0756d6a76a build(deps): bump actions/checkout from 2.4.0 to 3
Bumps [actions/checkout](https://github.com/actions/checkout) from 2.4.0 to 3.
- [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.4.0...v3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-06 08:56:58 +02:00
dependabot[bot]
0c73e88cfa build(deps): bump actions/github-script from 5 to 6
Bumps [actions/github-script](https://github.com/actions/github-script) from 5 to 6.
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](https://github.com/actions/github-script/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/github-script
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-06 08:54:52 +02:00
Simon Steinbeiss
11593b8318 create-tag: Set the release time to 13UTC 2022-03-23 13:57:56 +01:00
Simon Steinbeiss
53cb872aca create-tag: Don't check week for manual triggers
When a release is manually triggered we want to ignore whether it is an
odd or even week but allow the release in any case.
2022-03-23 13:57:56 +01:00
Simon Steinbeiss
64be96017f create-tag: Fix bash typo
This seems to be a bit special in GitHub Actions with bash:
https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-environment-variable
2022-03-23 13:57:56 +01:00
Simon Steinbeiss
86bf942780 create-tag: Fix upstream release schedule
We're counting the even and odd weeks since the Unix epoch, so this
doesn't match the odd/even calendar weeks. Consequently let's switch to
odd weeks for composer.
2022-03-23 11:30:32 +01:00
Simon Steinbeiss
f521e9a800 Enable scheduled upstream releases
Instead of a human pushing a tag with the release notes let a bot do the
work.
The bot is part of our composite action in osbuild/release-action on the
create-tag branch. It calculates the next subsequent release version and
creates a tag based on pull request titles associated with the changes
since the last release.
Finally the tag is pushed to the repository.

Unfortunately GH Actions don't allow for reliably fortnightly schedules,
so we do an additional check that determines if this is an even or an
odd week. This will help with correctly scheduling alternating osbuild
and osbuild-composer releases.
2022-03-22 17:50:57 +01:00
Jakub Rusz
46a79a48da workflows: Fix Gitlab CI trigger + revert debug
Previous implementation added single quotes to the git command which
made it not trigger the Gitlab CI at all. Changing it to clasic bash if
condition.
2022-03-21 10:42:28 +01:00
Jakub Rusz
eb4c9be168 workflows: debug Gitlab CI trigger 2022-03-18 12:59:40 +01:00
Jakub Rusz
c91131ee0c github workflows: modify Gitlab CI trigger
In 5e639cba6f the context of the Trigger
Gitalb CI workflow changed and the context
"github.event.pull_request.draft" is no longer available so the
condition for SKIP_CI didn't work. This can be fixed by getting the
variable in the previous workflow and passin it as artifact. Docs:
https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#using-data-from-the-triggering-workflow
2022-03-14 14:40:23 +02:00
Achilleas Koutsou
e5675efc4a github: fix job names and IDs for the tests workflow
Flip the incorrect flip that happened in
e4baddfad1
2022-03-10 10:54:20 +01:00
Achilleas Koutsou
f449cd45e8 github/workflows: check dnf-json with pylint
Use a fedora container for dnf dependency.
Add a pylintrc file to the project with 120 max line length and
docstrings ignored.
2022-03-08 12:42:12 +01:00
Achilleas Koutsou
e4baddfad1 github/workflows: fix job names for the tests workflow
lint and unit-tests were accidentally swapped.
2022-03-08 12:42:12 +01:00
Jakub Rusz
ba4f49078a ci: skip CI for draft and WIP PRs
Let only the init stage run so that we have a link on PRs to the CI and
can trigger it manually if desired. PR template updated with this info.
Also use yaml anchors for rules to reduce duplication.
2022-03-08 11:53:09 +01:00
Ondřej Budai
b34571c1ec github: fetch more PRs when triggering gitlab
By default, the API will fetch only 30 open PRs. This is enough currently
as we have 35 open ones. Bump the limit to the maximum. 100 should be enough
for some time. 🤞

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2022-02-16 11:01:43 +01:00
Ondřej Budai
11893485cd github: split checks into 3 jobs
To speed it up a bit.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2022-02-16 10:00:25 +01:00
Ondřej Budai
5e639cba6f github: adapt the github trigger to work the same way as in osbuild
I basically just copied
7c9944ee18/.github/workflows/trigger-gitlab.yml

and:
- changed osbuild to osbuild-composer
- add a SKIP_CI mechanism

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2022-02-10 16:16:30 +01:00
Ondřej Budai
f66740fdbd github: fix gitlab trigger
With the quoting, we are passing an empty variable instead of no argument.
Also, if the skip is required, we are passing "-o ci.skip" instead of
"-o" "ci.skip".

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2022-02-08 10:03:59 +01:00
Roy Golan
e8dd3654d5 Allow skipping CI for draft PR or WIP label
Save resources and needless CI runs by skipping the trigger-gitlab job if a PR is 'draft' (can be set in the pull request page at any time) or by setting a label "WIP".

Asside from saving resources, WIP PRs that don't trigger CI are a good message to a contributers to keep testing it locally and to only get the project resources after serious testing been made on their side.
2022-02-08 08:24:23 +01:00
Ondřej Budai
b667df4443 bump the minimum Go version to 1.16
Fedora 34 ships 1.16
RHEL 8.5 also ships 1.16

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2022-01-12 11:35:06 +01:00
dependabot[bot]
818e1bd040 build(deps): bump actions/setup-go from 2.1.4 to 2.1.5
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 2.1.4 to 2.1.5.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](https://github.com/actions/setup-go/compare/v2.1.4...v2.1.5)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-03 09:04:03 +01:00
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
sanne
f284e2a932 .github: Bump fedora container version for rpmlint 2021-12-17 13:13:05 +01:00
Simon Steinbeiss
d41ae15220 release-action: Send notification to our Slack channel
Passing the webhook URL is necessary because GH composite actions don't
support handling secrets.
See also https://github.com/osbuild/release-action/pull/3

[skip ci]
2021-12-13 09:48:34 +01:00
Alexander Todorov
1547451ee1 ci: Install gssapi/gssapi.h for Coverity Scan 2021-12-02 11:31:41 +01:00