Code: One CI pipeline for GitHub, Gitea and Forgejo
One pipeline for GitHub, Gitea and Forgejo: the code
tempo/ is the example project of the talk, complete: a made-up command line tool that adds up durations, with its modules, tests, book and CI. It runs with Jennifer 0.27.0 and needs no decks and no server. To try the pipeline on a forge, copy tempo/ into a new repository of its own; the workflow expects it at the repository root. site/ (the built book) and .ci/ (the downloaded interpreter and Grimoire) are generated, keep them out of git.
tempo/bin/tempo,tempo/src/parse.j,tempo/src/format.j: the tool and its two modules with docblocks ("The example: tempo", "A module with docblocks"; the slide showsformat.jshortened). Run, fromtempo/:jennifer run bin/tempo 1h30m 45m 30s(prints2h15m30s)tempo/src/parse_test.j,tempo/src/format_test.j: the test overlays. Run, fromtempo/:jennifer test src/parse_test.jtempo/tools/check.sh: the gate, fmt, lint, docblocks and tests ("The gate is a script, not YAML", "A green run"). Run, fromtempo/:sh tools/check.shtempo/tools/docblocks.j: reports docblocks that do not match their code, with the bundleddocblock.jmodule ("Docblocks: the standard library checks them").check.shruns it on the non-test sources.tempo/tools/install-jennifer.sh: downloads and verifies a pinned release into.ci/and writesGITHUB_PATH/GITHUB_ENV("Installing Jennifer: from the release"). Meant for CI; run locally it needs those two variables set to files, for exampleGITHUB_PATH=/dev/null GITHUB_ENV=/dev/null sh tools/install-jennifer.sh 0.27.0. Needscurl,tar,sha256sumand network access.tempo/tools/docs.sh,tempo/grimoire.toml,tempo/docs/: build the book with a pinned Grimoire intosite/("The book: a pinned Grimoire"). Run, fromtempo/:sh tools/docs.sh 0.5.0(clones Grimoire from GitHub into.ci/grimoire; remove that folder before running it again).tempo/.github/workflows/ci.yml: the one workflow with thecheck,docsand GitHub-onlypagesjobs ("ci.yml: one gate", "ci.yml: the book, on every forge", "ci.yml: Pages, on GitHub only"). Gitea and Forgejo read.github/workflows/too when they have no.gitea/or.forgejo/folder.red-run.sh: makes four broken copies oftempo/, one per check (a reindented line, an unused import and local, a renamed@param, a wrong expected value), and runstools/check.shin each ("A red run: what each check catches").tempo/itself is not changed. Run, from this folder:sh red-run.sh [target-dir](default: a new temporary directory, printed at the end).
| File | Size | |
|---|---|---|
| LICENSE | 899 B | raw |
| README.md | 2.6 KiB | raw |
| red-run.sh | 1.1 KiB | raw |
| tempo/.github/workflows/ci.yml | 1.0 KiB | in the zip |
| tempo/bin/tempo | 418 B | raw |
| tempo/docs/SUMMARY.md | 51 B | raw |
| tempo/docs/index.md | 118 B | raw |
| tempo/docs/usage.md | 206 B | raw |
| tempo/grimoire.toml | 131 B | raw |
| tempo/src/format.j | 859 B | raw |
| tempo/src/format_test.j | 181 B | raw |
| tempo/src/parse.j | 1.0 KiB | raw |
| tempo/src/parse_test.j | 377 B | raw |
| tempo/tools/check.sh | 364 B | raw |
| tempo/tools/docblocks.j | 548 B | raw |
| tempo/tools/docs.sh | 258 B | raw |
| tempo/tools/install-jennifer.sh | 423 B | raw |