- Install direnv: https://direnv.net/docs/installation.html
- Add a .envrc with contents:
use flake 'github:UbiqueLambda/devenv-elm#elm' --impure --accept-flake-config
If using elm-pages, then replace #elm
with #elm-pages
.
You'll find the following scripts in $PATH
to help you:
env-build
(builds todist
)env-ci
(the executable that the CI should call)env-dry-build
(builds without outputting any file)env-fmt
(formats all files with elm-format & prettier)env-gen-schema
(configurable*, converts GraphQL schemas to Elm files)env-gen-sprite
(buildsdist/sprite.svg
bundling all files invectors/*.svg
)env-lint
(which callsenv-elm-review
)env-up
(runs elm's reactor, orelm-pages dev
)
Configurable*: You can set a few parameters in a .env-config
file you can commit to public repos. NOTE: Don't put secrets in it; for secrets, use .env
file instead.
This CI example works OOTB (and tested on an Aarch64 self-hosted runner).
name: CI
on:
pull_request:
jobs:
check:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- name: Run "devenv ci"
run: |
nix develop \
'https://flakehub.com/f/UbiqueLambda/devenv-elm/0.1.19.tar.gz#elm' --impure --accept-flake-config \
--command env-ci
Nothing here is tested first and very prone to radical changes.