Compare commits

..
1 Commits
Author SHA1 Message Date
libretech 707ca854fb ci: run the unit tests, and build images only for pull requests and releases
build / test (pull_request) Failing after 15s
build / build (pull_request) Skipped
Every push to main published :main and :sha-* images, which nothing pulls.
The libreshop images had grown to 5.8 GB in the registry, on a Gitea host that
is nearly out of space.

- test: npm test on Node 22.14.0, the Node of the image, for every pull
  request, every push to main and every release tag.
- build: after the tests, for a pull request (build only) and for a v* tag
  (build and, with PUBLISH_ENABLED, publish :vX.Y.Z and :latest).

Refs libretech/mp#71
2026-10-08 22:26:46 +02:00
+8 -7
View File
@@ -16,13 +16,14 @@ jobs:
steps:
- uses: actions/checkout@v4
# The tests need no dependencies. They run in the image's base (Dockerfile FROM), so on the runtime's Node,
# without network. The source is piped in because the job container's paths do not exist on the Docker host.
- name: npm test, on the Node of the image
run: |
base=$(sed -n 's/^FROM \([^ ]*\).*/\1/p' Dockerfile | head -1)
tar -c --exclude=.git . | docker run -i --rm --network none -e npm_config_update_notifier=false "$base" \
sh -c 'mkdir /w && cd /w && tar -x && npm test'
# The Node version of the image (Dockerfile FROM), so the tests run on the runtime's Node.
- uses: actions/setup-node@v4
with:
node-version: "22.14.0"
- run: npm test
env:
npm_config_update_notifier: "false"
# The image is built to check a pull request, and built and published only for a release tag.
# Nothing pulls per-commit images, so main no longer publishes :main and :sha-* images.