Skip to content

Commit e4c0185

Browse files
authored
Merge pull request #16 from coq-community/dune-nix-ci
use Dune in repo opam packages, use Nix CI
2 parents d0b1dcb + 0fd19a7 commit e4c0185

File tree

5 files changed

+65
-15
lines changed

5 files changed

+65
-15
lines changed

.github/workflows/nix-action.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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+
paths:
11+
- .github/workflows/**
12+
pull_request_target:
13+
14+
jobs:
15+
build:
16+
runs-on: ubuntu-latest
17+
strategy:
18+
matrix:
19+
overrides:
20+
- 'coq = "master"'
21+
fail-fast: false
22+
steps:
23+
- name: Determine which commit to test
24+
run: |
25+
if [[ ${{ github.event_name }} =~ "pull_request" ]]; then
26+
merge_commit=$(git ls-remote ${{ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge | cut -f1)
27+
if [ -z "$merge_commit" ]; then
28+
echo "tested_commit=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV
29+
else
30+
echo "tested_commit=$merge_commit" >> $GITHUB_ENV
31+
fi
32+
else
33+
echo "tested_commit=${{ github.sha }}" >> $GITHUB_ENV
34+
fi
35+
- uses: cachix/install-nix-action@v14
36+
with:
37+
nix_path: nixpkgs=channel:nixpkgs-unstable
38+
- uses: cachix/cachix-action@v10
39+
with:
40+
name: coq-community
41+
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
42+
extraPullNames: coq, math-comp
43+
- uses: actions/checkout@v2
44+
with:
45+
ref: ${{ env.tested_ref }}
46+
- run: >
47+
nix-build https://coq.inria.fr/nix/toolbox --argstr job qarith-stern-brocot --arg override '{ ${{ matrix.overrides }}; qarith-stern-brocot = builtins.filterSource (path: _: baseNameOf path != ".git") ./.; }'

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Follow the instructions on https://github.com/coq-community/templates to regener
55
# Binary Rational Numbers
66

77
[![Docker CI][docker-action-shield]][docker-action-link]
8+
[![Nix CI][nix-action-shield]][nix-action-link]
89
[![Contributing][contributing-shield]][contributing-link]
910
[![Code of Conduct][conduct-shield]][conduct-link]
1011
[![Zulip][zulip-shield]][zulip-link]
@@ -13,6 +14,9 @@ Follow the instructions on https://github.com/coq-community/templates to regener
1314
[docker-action-shield]: https://github.com/coq-community/qarith-stern-brocot/workflows/Docker%20CI/badge.svg?branch=master
1415
[docker-action-link]: https://github.com/coq-community/qarith-stern-brocot/actions?query=workflow:"Docker%20CI"
1516

17+
[nix-action-shield]: https://github.com/coq-community/qarith-stern-brocot/workflows/Nix%20CI/badge.svg?branch=master
18+
[nix-action-link]: https://github.com/coq-community/qarith-stern-brocot/actions?query=workflow:"Nix%20CI"
19+
1620
[contributing-shield]: https://img.shields.io/badge/contributions-welcome-%23f7931e.svg
1721
[contributing-link]: https://github.com/coq-community/manifesto/blob/master/CONTRIBUTING.md
1822

@@ -26,7 +30,7 @@ Follow the instructions on https://github.com/coq-community/templates to regener
2630
[doi-shield]: https://zenodo.org/badge/DOI/10.1007/978-3-540-24849-1_20.svg
2731
[doi-link]: https://doi.org/10.1007/978-3-540-24849-1_20
2832

29-
Development of rational numbers as finite binary lists and defining
33+
Development of rational numbers in Coq as finite binary lists and defining
3034
field operations on them in two different ways: strict and lazy.
3135

3236

@@ -66,8 +70,7 @@ make install
6670

6771
## Documentation
6872

69-
This package contains a rational arithmetic library for Coq.
70-
This includes:
73+
This project contains a rational arithmetic library for Coq. This includes:
7174

7275
- A binary representation for positive rational numbers `Qpositive` and its
7376
extension to `Q` by adding sign bit (also known as Stern-Brocot

coq-qarith-stern-brocot.opam

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
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-
41
opam-version: "2.0"
52
maintainer: "[email protected]"
63
version: "dev"
@@ -10,15 +7,15 @@ dev-repo: "git+https://github.com/coq-community/qarith-stern-brocot.git"
107
bug-reports: "https://github.com/coq-community/qarith-stern-brocot/issues"
118
license: "LGPL-2.1-or-later"
129

13-
synopsis: "Binary rational numbers"
10+
synopsis: "Binary rational numbers in Coq"
1411
description: """
15-
Development of rational numbers as finite binary lists and defining
12+
Development of rational numbers in Coq as finite binary lists and defining
1613
field operations on them in two different ways: strict and lazy.
1714
"""
1815

19-
build: [make "-j%{jobs}%" ]
20-
install: [make "install"]
16+
build: ["dune" "build" "-p" name "-j" jobs]
2117
depends: [
18+
"dune" {>= "2.5"}
2219
"coq" {(>= "8.14" & < "8.15~") | (= "dev")}
2320
]
2421

meta.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ shortname: qarith-stern-brocot
44
organization: coq-community
55
community: true
66
action: true
7+
nix: true
78

8-
synopsis: Binary rational numbers
9+
synopsis: Binary rational numbers in Coq
910

1011
description: |
11-
Development of rational numbers as finite binary lists and defining
12+
Development of rational numbers in Coq as finite binary lists and defining
1213
field operations on them in two different ways: strict and lazy.
1314
1415
doi: 10.1007/978-3-540-24849-1_20
@@ -40,6 +41,9 @@ tested_coq_opam_versions:
4041
- version: dev
4142
- version: '8.14'
4243

44+
tested_coq_nix_versions:
45+
- coq_version: 'master'
46+
4347
namespace: QArithSternBrocot
4448

4549
keywords:
@@ -56,8 +60,7 @@ categories:
5660
documentation: |
5761
## Documentation
5862
59-
This package contains a rational arithmetic library for Coq.
60-
This includes:
63+
This project contains a rational arithmetic library for Coq. This includes:
6164
6265
- A binary representation for positive rational numbers `Qpositive` and its
6366
extension to `Q` by adding sign bit (also known as Stern-Brocot

theories/dune

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
(name QArithSternBrocot)
33
(package coq-qarith-stern-brocot)
44
(synopsis "Binary rational numbers")
5-
(flags -w -notation-overridden))
5+
(flags :standard -w -notation-overridden))

0 commit comments

Comments
 (0)