Skip to content

Commit 7d7a39b

Browse files
Merge request #727 GitHub CI: autogenerate the README TOC
When README changes in master, this workflow runs and autochecks, autogenerates the idempotent TOC and autocommits it, so project TOC persistently stays current.
2 parents fea80a5 + 0716f31 commit 7d7a39b

File tree

2 files changed

+64
-30
lines changed

2 files changed

+64
-30
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: "On README change"
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
paths:
8+
- "README.md"
9+
10+
jobs:
11+
12+
build10:
13+
name: "Check TOC, autogenerate and commit it into the PR"
14+
runs-on: ubuntu-latest
15+
continue-on-error: true
16+
steps:
17+
- name: Install doctoc
18+
run: |
19+
sudo npm install -g doctoc
20+
- uses: actions/checkout@v2
21+
with:
22+
# 2020-09-29: Official doc:
23+
# "In non-push events, such as pull_request, make sure to specify the ref to checkout:'
24+
ref: ${{ github.head_ref }}
25+
- name: Generate the idenpotent TOC
26+
run: |
27+
doctoc --github --notitle README.md
28+
- name: Commit and push changes
29+
uses: stefanzweifel/git-auto-commit-action@v4
30+
with:
31+
commit_author: "Anton Latukha <[email protected]>"
32+
commit_message: "[auto] upd README TOC"
33+
file_pattern: "README.md"

README.md

Lines changed: 31 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# hnix
22

3+
Haskell parser, evaluator and type checker for the Nix language.
4+
5+
## Contents
6+
7+
<!-- TOC generates automatically, do not bother editing any further TOC text -->
8+
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
9+
10+
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
11+
12+
---
13+
314
| [![Chat](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/haskell-nix/Lobby) | CI |
415
| :--- | :--- |
516
| [![Hackage](https://img.shields.io/hackage/v/hnix?color=%235e5086&label=Latest%20release)](https://hackage.haskell.org/package/hnix) | [![Hackage, Cabal, Linux](https://github.com/haskell-nix/hnix/workflows/Hackage,%20Cabal,%20Linux/badge.svg)](https://github.com/haskell-nix/hnix/actions?query=workflow%3A"Hackage%2C+Cabal%2C+Linux"+branch%3Amaster) |
@@ -8,21 +19,7 @@
819
| [![Release dependencies](https://img.shields.io/hackage-deps/v/hnix?label=Release%20dependencies)](https://packdeps.haskellers.com/feed?needle=hnix) | [![Nixpkgs, macOS](https://github.com/haskell-nix/hnix/workflows/Nixpkgs,%20macOS/badge.svg)](https://github.com/haskell-nix/hnix/actions?query=workflow%3A%22Nixpkgs%2C+macOS%22+branch%3Amaster) |
920
| [![Repology page](https://img.shields.io/badge/Repology-page-%23005500)](https://repology.org/project/haskell:hnix/versions) | |
1021

11-
Haskell parser, evaluator and type checker for the Nix language.
12-
13-
## Contents
14-
15-
<!-- TOC -->
16-
- [Prerequisites](#prerequisites)
17-
- [Getting Started](#getting-started)
18-
- [Using the REPL](#using-the-repl)
19-
- [Building with full debug info](#building-with-full-debug-info)
20-
- [Building with benchmarks enabled](#building-with-benchmarks-enabled)
21-
- [Building with profiling enabled](#building-with-profiling-enabled)
22-
- [Using the Cachix binary cache](#using-the-cachix-binary-cache)
23-
- [Contributing](#contributing)
24-
- [Evaluating Nixpkgs with HNix](#evaluating-nixpkgs-with-hnix)
25-
<!-- /TOC -->
22+
---
2623

2724
## Prerequisites
2825
Until `hnix-store` is ready, `nix-store` is still used for interacting with the store paths, so Nix is still required installed and available through `$PATH`.
@@ -72,20 +69,19 @@ hnix --eval -E '(import <nixpkgs> {}).pkgs.hello' --repl
7269
7370
Use the `:help` command for a list of all available REPL commands.
7471
75-
## Building with full debug info
7672
77-
To build `hnix` for debugging, and with full tracing output and stack traces, use:
73+
## Cachix prebuild binary caches
7874
79-
```
80-
nix-shell
81-
cabal v2-configure --enable-tests --enable-profiling --flags=profiling --flags=tracing
82-
cabal v2-build
83-
cabal v2-run hnix -- -v5 --trace <args> +RTS -xc
84-
```
75+
To autoload prebuild project dependencies - please, enable the official HNix Cachix binary cache:
8576
86-
Note that this will run quite slowly, but will give the most information as to what might potentially be going wrong during parsing or evaluation.
77+
1. Go through https://cachix.org/ and set it up.
78+
79+
2. Run: `cachix use hnix`
80+
81+
82+
## Building
8783
88-
## Building with benchmarks enabled
84+
### With benchmarks
8985
9086
To build `hnix` with benchmarks enabled:
9187
@@ -96,7 +92,7 @@ cabal v2-build
9692
cabal v2-bench
9793
```
9894
99-
## Building with profiling enabled
95+
### With profiling
10096
10197
To build `hnix` with profiling enabled:
10298
@@ -107,15 +103,20 @@ cabal v2-build
107103
cabal v2-run hnix -- <args> +RTS -p
108104
```
109105
110-
## Using the Cachix binary cache
106+
### With full debug info
111107
112-
If you're on macOS, you can use the binary cache at Cachix to avoid building the specific dependencies used by hnix. Just use these commands:
108+
To build `hnix` for debugging, with full tracing output and stack traces:
113109
114110
```
115-
nix-env -iA cachix -f https://github.com/NixOS/nixpkgs/tarball/db557aab7b690f5e0e3348459f2e4dc8fd0d9298
116-
cachix use hnix
111+
nix-shell
112+
cabal v2-configure --enable-tests --enable-profiling --flags=profiling --flags=tracing
113+
cabal v2-build
114+
cabal v2-run hnix -- -v5 --trace <args> +RTS -xc
117115
```
118116
117+
Note that this will run quite slowly, but will give the most information as to what might potentially be going wrong during parsing or evaluation.
118+
119+
119120
## Contributing
120121
121122
1. If something in the [quests](https://github.com/haskell-nix/hnix/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22+no%3Aassignee) looks interesting, look through the thread and leave a comment taking it, to let others know you're working on it.

0 commit comments

Comments
 (0)