From 39ab23beb6227403a3a2948028909273ddb3e108 Mon Sep 17 00:00:00 2001 From: Giovanni Date: Mon, 24 Aug 2026 16:43:48 +0200 Subject: [PATCH] runs GitHub Actions workflows locally in Docker using https://github.com/nektos/act --- .github/act/README.md | 29 +++++++++++++++++++++++++++++ .github/act/act-event.json.dist | 8 ++++++++ .github/act/act.env.dist | 1 + 3 files changed, 38 insertions(+) create mode 100644 .github/act/README.md create mode 100644 .github/act/act-event.json.dist create mode 100644 .github/act/act.env.dist diff --git a/.github/act/README.md b/.github/act/README.md new file mode 100644 index 0000000000..967c5b3bfe --- /dev/null +++ b/.github/act/README.md @@ -0,0 +1,29 @@ +# Running spamassassin_make_test.yml locally with `act` + +[`act`](https://github.com/nektos/act) runs GitHub Actions workflows locally in Docker, so you can test +`.github/workflows/spamassassin_make_test.yml` without pushing to GitHub. + +## Files + +Copy each `.dist` template to drop the `.dist` suffix, then edit as needed: + +```bash +cp .github/act/act-event.json.dist .github/act/act-event.json +cp .github/act/act.env.dist .github/act/act.env +``` + +- `act-event.json` — the `workflow_dispatch` event payload. Set `inputs.runners`, `inputs.perls`, + `inputs.database` (each a JSON-encoded string, matching the workflow's own input defaults) to pick + which OS/perl/database combinations to run, and `inputs.tests` to a `t/*.t` glob to restrict which + tests run. +- `act.env` — environment variables passed into the job containers, e.g. `PERL_MM_USE_DEFAULT=1`. + +## Run + +```bash +# dry run — show what would execute without running it +act -n -e .github/act/act-event.json --env-file .github/act/act.env + +# real run +act -e .github/act/act-event.json --env-file .github/act/act.env +``` diff --git a/.github/act/act-event.json.dist b/.github/act/act-event.json.dist new file mode 100644 index 0000000000..5b44d19942 --- /dev/null +++ b/.github/act/act-event.json.dist @@ -0,0 +1,8 @@ +{ + "inputs": { + "runners": "[\"ubuntu-latest\"]", + "perls": "[40]", + "database": "[\"none\"]", + "tests": "" + } +} diff --git a/.github/act/act.env.dist b/.github/act/act.env.dist new file mode 100644 index 0000000000..ece16e9cf1 --- /dev/null +++ b/.github/act/act.env.dist @@ -0,0 +1 @@ +PERL_MM_USE_DEFAULT=1