Shared CI actions, the test report and the dependency scan (managed by Ansible)
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-11-20 22:04:46 +00:00
dependency-scan Update dependency-scan/action.yml (Ansible) 2026-11-12 07:10:16 +00:00
nextcloud-app-release Update nextcloud-app-release/action.yml (Ansible) 2026-11-05 19:30:23 +00:00
nextcloud-app-server Update nextcloud-app-server/action.yml (Ansible) 2026-11-06 21:35:26 +00:00
test-report Update test-report/action.yml (Ansible) 2026-11-01 16:32:01 +00:00
ci-report.py Update ci-report.py (Ansible) 2026-11-01 16:31:59 +00:00
nextcloud-app-server.py Update nextcloud-app-server.py (Ansible) 2026-11-07 11:31:42 +00:00
nextcloud-release.py Update nextcloud-release.py (Ansible) 2026-11-05 19:30:21 +00:00
README.md Update README.md (Ansible) 2026-11-20 22:04:42 +00:00

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 with fail-on (never by default).
  • nextcloud-app-release: a Nextcloud app's release from its tag vX.Y.Z (the version in appinfo/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 of CHANGELOG.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), every occ command loads, its background jobs run, it is disabled and enabled again, the app's own check passes, and nextcloud.log has no error of the app. An External App's image (exapp-image) is registered with AppAPI on a manual-install daemon 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).