Skip to content

Commit 6ae8bad

Browse files
committed
Trying out meta.yml with nix action
1 parent 5982d90 commit 6ae8bad

File tree

9 files changed

+474
-142
lines changed

9 files changed

+474
-142
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# This file was generated from `meta.yml`, please do not edit manually.
2+
# Follow the instructions on https://github.com/coq-community/templates to regenerate.
3+
name: Docker CI
4+
5+
on:
6+
push:
7+
branches:
8+
- master
9+
pull_request:
10+
branches:
11+
- '**'
12+
13+
jobs:
14+
build:
15+
# the OS must be GNU/Linux to be able to use the docker-coq-action
16+
runs-on: ubuntu-latest
17+
strategy:
18+
matrix:
19+
image:
20+
- 'coqorg/coq:8.11'
21+
- 'coqorg/coq:8.12'
22+
- 'coqorg/coq:8.13'
23+
fail-fast: false
24+
steps:
25+
- uses: actions/checkout@v2
26+
- uses: coq-community/docker-coq-action@v1
27+
with:
28+
opam_file: 'coq-hierarchy-builder.opam'
29+
custom_image: ${{ matrix.image }}
30+
31+
# See also:
32+
# https://github.com/coq-community/docker-coq-action#readme
33+
# https://github.com/erikmd/docker-coq-github-action-demo

.github/workflows/main.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.

.github/workflows/nix-action.yml

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
# This file was generated from `meta.yml`, please do not edit manually.
2+
# Follow the instructions on https://github.com/coq-community/templates to regenerate.
3+
name: Nix CI
4+
5+
on:
6+
push:
7+
branches:
8+
- master
9+
pull_request:
10+
branches:
11+
- '**'
12+
13+
jobs:
14+
prerequisites:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Cachix install
19+
uses: cachix/install-nix-action@v12
20+
with:
21+
nix_path: nixpkgs=channel:nixpkgs-unstable
22+
- name: Cachix setup
23+
uses: cachix/cachix-action@v8
24+
with:
25+
# Name of a cachix cache to pull/substitute
26+
name: math-comp
27+
extraPullNames: coq
28+
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
29+
- name: Cache Nix Store
30+
uses: actions/[email protected]
31+
id: cache-nix
32+
with:
33+
path: nix-store.nar
34+
key: nix-${{ runner.os }}-${{ github.sha }}
35+
restore-keys: |
36+
nix-${{ runner.os }}-
37+
- name: Import Nix Store
38+
if: steps.cache-nix.outputs.cache-hit
39+
run: nix-store --import < nix-store.nar
40+
- name: Git checkout
41+
uses: actions/checkout@v2
42+
with:
43+
fetch-depth: 0
44+
- name: Build
45+
run: nix-build --arg ci true --arg ci-step 0
46+
- name: Compute Closure
47+
run: nix-build --arg ci true --arg ci-step 0 | xargs nix path-info -r | tee closure.txt
48+
- name: Export Nix Store
49+
run: xargs --arg-file=closure.txt nix-store --export > nix-store.nar
50+
51+
main:
52+
runs-on: ubuntu-latest
53+
needs: prerequisites
54+
55+
steps:
56+
- name: Cachix install
57+
uses: cachix/install-nix-action@v12
58+
with:
59+
nix_path: nixpkgs=channel:nixpkgs-unstable
60+
- name: Cachix setup
61+
uses: cachix/cachix-action@v8
62+
with:
63+
# Name of a cachix cache to pull/substitute
64+
name: math-comp
65+
extraPullNames: coq
66+
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
67+
- name: Cache Nix Store
68+
uses: actions/[email protected]
69+
id: cache-nix
70+
with:
71+
path: nix-store.nar
72+
key: nix-${{ runner.os }}-${{ github.sha }}
73+
restore-keys: |
74+
nix-${{ runner.os }}-
75+
- name: Import Nix Store
76+
if: steps.cache-nix.outputs.cache-hit
77+
run: nix-store --import < nix-store.nar
78+
- name: Git checkout
79+
uses: actions/checkout@v2
80+
with:
81+
fetch-depth: 0
82+
- name: Build
83+
run: nix-build --arg ci true --arg ci-step 1
84+
- name: Compute Closure
85+
run: nix-build --arg ci true --arg ci-step 1 | xargs nix path-info -r | tee closure.txt
86+
- name: Export Nix Store
87+
run: xargs --arg-file=closure.txt nix-store --export > nix-store.nar
88+
89+
CI:
90+
runs-on: ubuntu-latest
91+
needs: main
92+
93+
steps:
94+
- name: Cachix install
95+
uses: cachix/install-nix-action@v12
96+
with:
97+
nix_path: nixpkgs=channel:nixpkgs-unstable
98+
- name: Cachix setup
99+
uses: cachix/cachix-action@v8
100+
with:
101+
# Name of a cachix cache to pull/substitute
102+
name: math-comp
103+
extraPullNames: coq
104+
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
105+
- name: Cache Nix Store
106+
uses: actions/[email protected]
107+
id: cache-nix
108+
with:
109+
path: nix-store.nar
110+
key: nix-${{ runner.os }}-${{ github.sha }}
111+
restore-keys: |
112+
nix-${{ runner.os }}-
113+
- name: Import Nix Store
114+
if: steps.cache-nix.outputs.cache-hit
115+
run: nix-store --import < nix-store.nar
116+
- name: Git checkout
117+
uses: actions/checkout@v2
118+
with:
119+
fetch-depth: 0
120+
- name: Build
121+
run: nix-build --arg ci true --arg ci-step 2
122+
- name: Compute Closure
123+
run: nix-build --arg ci true --arg ci-step 2 | xargs nix path-info -r | tee closure.txt
124+
- name: Export Nix Store
125+
run: xargs --arg-file=closure.txt nix-store --export > nix-store.nar

.github/workflows/nix.yml

Lines changed: 0 additions & 80 deletions
This file was deleted.

.nix/fallback-config.nix

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
format = "1.0.0";
3+
coq-attribute = "hiearchy-builder";
4+
5+
}

README.md

Lines changed: 73 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,77 @@
1-
[![Actions Status](https://github.com/math-comp/hierarchy-builder/workflows/CI/badge.svg)](https://github.com/math-comp/hierarchy-builder/actions)
2-
[![project chat](https://img.shields.io/badge/zulip-join_chat-brightgreen.svg)](https://coq.zulipchat.com/#narrow/stream/237868-Hierarchy-Buidlder)
3-
1+
<!---
2+
This file was generated from `meta.yml`, please do not edit manually.
3+
Follow the instructions on https://github.com/coq-community/templates to regenerate.
4+
--->
45
# Hierarchy Builder
56

6-
High level commands to declare and evolve a hierarchy based on packed classes.
7+
[![Docker CI][docker-action-shield]][docker-action-link]
8+
[![Nix CI][nix-action-shield]][nix-action-link]
9+
[![Chat][chat-shield]][chat-link]
10+
11+
[docker-action-shield]: https://github.com/math-comp/hierarchy-builder/workflows/Docker%20CI/badge.svg?branch=master
12+
[docker-action-link]: https://github.com/math-comp/hierarchy-builder/actions?query=workflow:"Docker%20CI"
13+
14+
[nix-action-shield]: https://github.com/math-comp/hierarchy-builder/workflows/Nix%20CI/badge.svg?branch=master
15+
[nix-action-link]: https://github.com/math-comp/hierarchy-builder/actions?query=workflow:"Nix%20CI"
16+
[chat-shield]: https://img.shields.io/badge/zulip-join_chat-brightgreen.svg
17+
[chat-link]: https://coq.zulipchat.com/#narrow/stream/237868-Hierarchy-Builder
18+
19+
20+
21+
22+
Hierarchy Builder is a high level language to build hierarchies of
23+
algebraic structures and make these hierarchies evolve without breaking
24+
user code. The key concepts are the ones of factory, builder and
25+
abbreviation that let the hierarchy developer describe an actual
26+
interface for their library. Behind that interface the developer can
27+
provide appropriate code to ensure retro compatibility.
28+
29+
## Meta
30+
31+
- Author(s):
32+
- Cyril Cohen (initial)
33+
- Kazuhiko Sakaguchi (initial)
34+
- Enrico Tassi (initial)
35+
- License: [MIT](LICENSE)
36+
- Compatible Coq versions: Coq 8.11 to 8.13 (or dev)
37+
- Additional dependencies:
38+
- [Coq elpi](https://github.com/LPCIC/coq-elpi)
39+
- Coq namespace: `HB`
40+
- Related publication(s):
41+
- [Hierarchy Builder: algebraic hierarchies made easy in Coq with Elpi](https://hal.inria.fr/hal-02478907) doi:[10.4230/LIPIcs.FSCD.2020.34](https://doi.org/10.4230/LIPIcs.FSCD.2020.34)
42+
- [Hierarchy Builder: FSCD Talk](https://www.youtube.com/watch?v=F6iRaTlQrlo))
43+
44+
## Building and installation instructions
45+
46+
### Opam installation
47+
48+
<details><summary>(click to expand)</summary><p>
49+
50+
The easiest way to install the latest released version of Hierarchy Builder
51+
is via [OPAM](https://opam.ocaml.org/doc/Install.html):
52+
53+
```shell
54+
opam repo add coq-released https://coq.inria.fr/opam/released
55+
opam install coq-hierarchy-builder
56+
```
57+
58+
</p></details>
59+
60+
### Manual installation
61+
62+
<details><summary>(click to expand)</summary><p>
63+
64+
To instead build and install manually, do:
65+
66+
``` shell
67+
git clone https://github.com/math-comp/hierarchy-builder.git
68+
cd hierarchy-builder
69+
make # or make -j <number-of-cores-on-your-machine>
70+
make install VFILES=structures.v
71+
```
72+
73+
</p></details>
774

8-
[Presented at FSCD2020, talk available on youtube.](https://www.youtube.com/watch?v=F6iRaTlQrlo)
975

1076
## Example
1177

@@ -74,21 +140,12 @@ The current version forces the carrier to be a type, ruling hierarchies of morph
74140
This [draft paper](https://hal.inria.fr/hal-02478907) describes the language
75141
in full detail.
76142

77-
#### Installation & availability
143+
#### Alternative Installation instructions
78144

79145
<details><summary>(click to expand)</summary><p>
80146

81-
HB works on Coq 8.10 and 8.11.
82-
83-
- You can install it via OPAM
84-
85-
```shell
86-
opam repo add coq-released https://coq.inria.fr/opam/released
87-
opam install coq-hierarchy-builder
88-
```
147+
- You can use it in nix with the attribute `coqPackages_8_13.hierarchy-builder` e.g. via `nix-shell -p coq_8_13 -p coqPackages_8_13.hierarchy-builder`
89148

90-
- You can use it in nix with the attribute `coqPackages_8_11.hierarchy-builder` e.g. via `nix-shell -p coq_8_11 -p coqPackages_8_11.hierarchy-builder`
91-
92149
</p></details>
93150

94151
#### Key concepts

0 commit comments

Comments
 (0)