This repo defines a GitHub Actions workflow useful for OCaml projects
hosted on GitHub and using the Dune build system. It defines
instructions for GitHub to automatically scan your project, generate a
dependency graph with dune-deps,
and commit the resulting image into your project as .deps/deps.png
.
You can then show the graph as part of your README.md
. The graph is
updated automatically within minutes of a push.
Disclaimer: If the author understands correctly, this is not a GitHub
action proper, but a workflow. An action is something you can
include in a yaml workflow. For instance in a workflow, the line
- uses: actions/checkout@master
invokes the action named "checkout",
which is registered with the GitHub Marketplace.
These are instructions for setting up a job by putting instructions into your git repo. The advantage is that it's similar to other CI providers (CircleCI, Travis, etc.) and lets you customize it without too much magic.
Copy
.github/workflows/dune-deps.yml
into your repo, same path. GitHub will find it automatically, as long
as Actions are not disabled for your repo or organization.
It can be achieved with the following instructions, from the root of your git project:
# Copy config
mkdir -p .github/workflows
curl -L -o .github/workflows/dune-deps.yml \
https://raw.githubusercontent.com/mjambon/dune-deps-action/master/.github/workflows/dune-deps.yml
# Normal add/commit/push
git add .github/workflows/dune-deps.yml
git commit .github/workflows/dune-deps.yml
git push origin master
Then visit the "Actions" tab on your project's GitHub page. You should see some work being done for the "dependency graph" workflow.
If successful, there should now be a .deps
folder at the root of your
project.
Insert the following snippet in your main README.md
file:
![dependency graph](.deps/deps.png)
For example, it might look something like this:
Note: It may take several minutes for the image rendered by the GitHub website to refresh after a change in the git repo.
If the dune-deps
command failed or you're not getting the graph you
want, you can customize it by editing the relevant line in
.github/workflows/dune-deps.yml
. Install dune-deps
on your
development machine (e.g. opam install dune-deps
) and check out
the available options with dune-deps --help
. See also the
dune-deps homepage for common
usage scenarios.
If anything goes wrong or is harder than it should, please open an issue to let us know.
The dune-deps-action project was initiated by Martin Jambon. It is placed in the Public Domain for the sake of convenience. See UNLICENSE.
Software maintenance takes time, skill, and effort. Please contribute to open-source projects to the best of your ability. Talk to your employer about it today.