Experimenting with github actions on a Nim project.
Nim is not a supported language with actions
yet so I started to
experiment with different ways to build a Nim project.
- Test - Just run tests over multiple nim versions and operating systems in one action.
- Native Build - Download and compile nim, build app
- DockerHub Image Build - Build and publish images to DockerHub using multiple nim versions
- Github Packages Build - Build and publish docker image to Github Packages
The code for the native build is found in
build-native.yml. It sets up a nim
environment by using choosenim
to build the nim compiler. Once
built, both nim and nimble are cached for subsequent runs in this same
repository. The cache isn't shared with other repositories
unfortunately.
It compiles the executable and publishes it as a build artifact.
The code is available in either
depending on where the final Docker image is published.
We're using Docker base images that already have Nim and Nimble installed in it so we get to skip the manual install step.
The Github Actions use files in dockerfiles/ for the builds.
To learn more, see the following: