- Python 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| dependency-scan | ||
| nextcloud-app-release | ||
| nextcloud-app-server | ||
| test-report | ||
| ci-report.py | ||
| nextcloud-app-server.py | ||
| nextcloud-release.py | ||
| README.md | ||
ci-actions
Shared actions for the workflows on git.ciepiela.org, kept by Ansible (HomeLab's role
forgejo): changes here are overwritten. The reports, test-report and dependency-scan, each post
one comment on the pull request, edited in place by every run; without a pull request the report is
only in the job's log.
test-report: the totals of the tests (JUnit XML,go test -json), the failed ones with the end of their message, and the coverage with its change against the base branch.dependency-scan: osv-scanner 2.7.1 on the lock files, its known vulnerabilities by severity; the job fails only withfail-on(never by default).nextcloud-app-release: a Nextcloud app's release from its tagvX.Y.Z(the version inappinfo/info.xml): its archive<app-id>-X.Y.Z.tar.gz, signed with the app store certificate's key when it is usable, on the tag's Forgejo release, whose text is the version's section ofCHANGELOG.md(## X.Y.Z - YYYY-MM-DD, required), and on the Nextcloud app store when there is a token and a signature. A missing key or token is a warning, not a failed release.nextcloud-app-server: a Nextcloud app on a real Nextcloud with PostgreSQL in the job's Docker (runs-on: ubuntu-latest): its app store release upgraded to the checkout (or installed afresh), everyocccommand loads, its background jobs run, it is disabled and enabled again, the app's owncheckpasses, andnextcloud.loghas no error of the app. An External App's image (exapp-image) is registered with AppAPI on amanual-installdaemon instead.
The reports need bash and Python 3 in the job's container (Debian's golang, python and node images
have them). A step of a job:
- name: Tests
id: tests
run: go test -json -coverprofile=/tmp/cover.out ./... > /tmp/go-test.json
# Also when the tests failed, not when they did not run.
- name: Test report
if: always() && steps.tests.outcome != 'skipped'
uses: https://git.ciepiela.org/dawid/ci-actions/test-report@main
with:
go-test-json: /tmp/go-test.json
coverage: /tmp/cover.out
- name: Dependency scan
if: always() && github.event_name == 'pull_request'
uses: https://git.ciepiela.org/dawid/ci-actions/dependency-scan@main
with:
path: .
fail-on: never
test-report takes junit (e.g. pytest's --junitxml), go-test-json, coverage (a Go cover
profile, go tool cover -func, Cobertura XML or coverage.py's report) and name; dependency-scan
takes path, fail-on (never, low, medium, high, critical) and name.
nextcloud-app-release needs bash, Python 3, openssl and ca-certificates (in
debian:bookworm-slim: apt-get install python3 openssl ca-certificates git), after a checkout of
the tag:
- name: Release
uses: https://git.ciepiela.org/dawid/ci-actions/nextcloud-app-release@main
with:
app-id: talk_stickers
include: LICENSE NOTICE.md
signing-key: ${{ secrets.NC_APP_SIGNING_KEY }}
app-store: ${{ vars.NC_APPSTORE != 'false' && secrets.NC_APPSTORE_TOKEN != '' }}
app-store-token: ${{ secrets.NC_APPSTORE_TOKEN }}
A secret cannot be empty, so an organisation's NC_APPSTORE_TOKEN is not overridden with nothing: the
repository's variable NC_APPSTORE set to false keeps that app off the app store instead.
It takes app-id, app-dir (default app/<app-id>), include (files added to the app's folder),
archive (one the job built instead), tag (default the one pushed), changelog (default
CHANGELOG.md), signing-key, attach-signature (false), app-store (true),
app-store-token and token (default the job's), and gives version, archive and download.
nextcloud-app-server needs Docker and Python 3, after a checkout:
- name: Check the app on Nextcloud ${{ matrix.nextcloud }}
uses: https://git.ciepiela.org/dawid/ci-actions/nextcloud-app-server@main
with:
app-id: talk_ai
nextcloud: ${{ matrix.nextcloud }}
apps: spreed
check: tests/server/check.sh
It takes app-id, app-dir (default app/<app-id>), nextcloud (the image's version, e.g. 32),
postgres (18-alpine), apps (apps of the app store installed first), upgrade (true),
skip-jobs (classes of background jobs not run), check (bash, with OCC, NEXTCLOUD_URL,
NEXTCLOUD_USER, NEXTCLOUD_PASSWORD and NEXTCLOUD_NETWORK), exapp-image (an External App's
image the job built: registered with AppAPI, app-dir the folder of its appinfo/info.xml; the
check also gets EXAPP_CONTAINER and EXAPP_IMAGE) and paths (app/** or files: without a change of one
since the pull request's base or the commit before the push, it passes at once). The same script runs locally:
python3 nextcloud-app-server.py run --app-dir app/talk_ai --nextcloud 32 --check tests/server/check.sh
(--keep leaves the containers running).
This repository is public, so that runners fetch it without signing in, and is not copied to GitHub
(forgejo_github_mirror.exclude in HomeLab).