Skip to content

Commit

Permalink
packit: Enable RPM builds and Fedora testing
Browse files Browse the repository at this point in the history
Cherry-pick starter-kit commit cockpit-project@a26f4048c2
  • Loading branch information
KKoukiou committed Jun 8, 2021
1 parent e0a0d7a commit 678644e
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,11 @@ devel-install: $(WEBPACK_TEST)
mkdir -p ~/.local/share/cockpit
ln -s `pwd`/dist ~/.local/share/cockpit/$(PACKAGE_NAME)

print-version:
@echo "$(VERSION)"

dist-gzip: $(TARFILE)
@ls -1 $(TARFILE)

# when building a distribution tarball, call webpack with a 'production' environment
# we don't ship node_modules for license and compactness reasons; we ship a
Expand Down Expand Up @@ -159,4 +163,4 @@ $(NODE_MODULES_TEST): package.json
env -u NODE_ENV npm install
env -u NODE_ENV npm prune

.PHONY: all clean install devel-install dist-gzip srpm rpm check vm update-po
.PHONY: all clean install devel-install print-version dist-gzip srpm rpm check vm update-po
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,14 @@ up with security updates and bug fixes. This is done with the
[npm-update bot script](https://github.com/cockpit-project/bots/blob/master/npm-update)
which is run weekly or upon [manual request](https://github.com/skobyda/cockpit-certificates/actions) through the
[npm-update.yml](.github/workflows/npm-update.yml) [GitHub action](https://github.com/features/actions).

# Running tests in CI
Tests run in [Packit](https://packit.dev/) for all currently supported
Fedora releases; see the [packit.yaml](./packit.yaml) control file. You need to
[enable Packit-as-a-service](https://packit.dev/docs/packit-as-a-service/) in your GitHub project to use this.
To run the tests in the exact same way for upstream pull requests and for
[Fedora package update gating](https://docs.fedoraproject.org/en-US/ci/), the
tests are wrapped in the [FMF metadata format](https://github.com/psss/fmf)
for using with the [tmt test management tool](https://docs.fedoraproject.org/en-US/ci/tmt/).
Note that Packit tests can *not* run their own virtual machine images, thus
they only run [@nondestructive tests](https://github.com/martinpitt/cockpit/blob/master/test/common/testlib.py).
20 changes: 20 additions & 0 deletions packit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Enable RPM builds and running integration tests in PRs through https://packit.dev/
# To use this, enable Packit-as-a-service in GitHub: https://packit.dev/docs/packit-as-a-service/
# See https://packit.dev/docs/configuration/ for the format of this file

specfile_path: cockpit-certificates.spec
actions:
post-upstream-clone: make cockpit-certificates.spec
# reduce memory consumption of webpack in sandcastle container
# https://github.com/packit/sandcastle/pull/92
# https://medium.com/the-node-js-collection/node-js-memory-management-in-container-environments-7eb8409a74e8
create-archive: make NODE_OPTIONS=--max-old-space-size=500 dist-gzip
# certificates.git has no release tags; your project can drop this once you have a release
get-current-version: make print-version
jobs:
- job: tests
trigger: pull_request
metadata:
targets:
- fedora-34
- fedora-rawhide

0 comments on commit 678644e

Please sign in to comment.