-
Notifications
You must be signed in to change notification settings - Fork 22
Potential podman-based adjustment to the docker command #87
Description
So, I released org-gtd 3.0 and dropped support for emacs 27.1 because I couldn't run tests on it locally (silex doesn't have a 27.1 tag). I opened an issue about it for silex, but then I wondered how much of this could be done with ... fewer dependencies.
So I went and looked at the Github Actions I use for CI. Long story short, here's a first pass:
- A Containerfile
- A command to build an image with a given version of emacs in it
- Running the tests in a container made from that particular image
Containerfile
Do note the use of emacs_version provided as a CLI arg.
FROM nixos/nix:latest
# Install Cachix.
RUN nix-env -iA nixpkgs.cachix
# Set the Cachix cache name.
ENV CACHIX_NAME mycache
# Use Cachix.
RUN cachix use $CACHIX_NAME
ARG emacs_version
# Install emacs
RUN nix-env -iA emacs-$emacs_version -f https://github.com/purcell/nix-emacs-ci/archive/master.tar.gz
# Set the working directory.
WORKDIR /appBuilding the image
Here we pass emacs_version and we give the image a custom name -- stag-27-2, but could be eldev-27-2.
Using podman means the image remains local and docker does not do any funny business.
We use . for current directory, this is run in the root directory of the project, but you can tell from the Containerfile that doesn't matter.
podman build -t stag-27-2 -f Containerfile --build-arg emacs_version=27-2 .
Running the tests
Unsurprisingly, looks like this, reusing the name of the image provided above:
eldev -dt docker "localhost/stag-27-2" -C -dt test
So there's clearly some automation work required if we're going to make this happen more reliably, and it's also possible that we can make smaller images.
I'm not sure how I would integrate any of this into eldev functionality, though, but I am sharing it here in case it's of any help :)