Skip to content

Commit 2d21b9b

Browse files
committed
WIP UniMath
1 parent d7c4aa6 commit 2d21b9b

File tree

3 files changed

+82
-2
lines changed

3 files changed

+82
-2
lines changed

.github/workflows/nix-action-coq-master.yml

+63-1
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,58 @@ jobs:
356356
name: Building/fetching current CI target
357357
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
358358
--argstr job "StructTact"
359+
UniMath:
360+
needs:
361+
- coq
362+
runs-on: ubuntu-latest
363+
steps:
364+
- name: Determine which commit to initially checkout
365+
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{\
366+
\ github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha\
367+
\ }}\" >> $GITHUB_ENV\nfi\n"
368+
- name: Git checkout
369+
uses: actions/checkout@v3
370+
with:
371+
fetch-depth: 0
372+
ref: ${{ env.target_commit }}
373+
- name: Determine which commit to test
374+
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{\
375+
\ github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{\
376+
\ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge\
377+
\ | cut -f1)\n mergeable=$(git merge --no-commit --no-ff ${{ github.event.pull_request.base.sha\
378+
\ }} > /dev/null 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n\
379+
\ if [ -z \"$merge_commit\" -o \"x$mergeable\" != \"x0\" ]; then\n echo\
380+
\ \"tested_commit=${{ github.event.pull_request.head.sha }}\" >> $GITHUB_ENV\n\
381+
\ else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n fi\nfi\n"
382+
- name: Git checkout
383+
uses: actions/checkout@v3
384+
with:
385+
fetch-depth: 0
386+
ref: ${{ env.tested_commit }}
387+
- name: Cachix install
388+
uses: cachix/install-nix-action@v27
389+
with:
390+
nix_path: nixpkgs=channel:nixpkgs-unstable
391+
- name: Cachix setup coq-community
392+
uses: cachix/cachix-action@v15
393+
with:
394+
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
395+
extraPullNames: coq, math-comp
396+
name: coq-community
397+
- id: stepCheck
398+
name: Checking presence of CI target UniMath
399+
run: "nb_dry_run=$(NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr\
400+
\ bundle \"coq-master\" --argstr job \"UniMath\" \\\n --dry-run 2>&1 > /dev/null)\n\
401+
echo $nb_dry_run\necho status=$(echo $nb_dry_run | grep \"built:\" | sed \"\
402+
s/.*/built/\") >> $GITHUB_OUTPUT\n"
403+
- if: steps.stepCheck.outputs.status == 'built'
404+
name: 'Building/fetching previous CI target: coq'
405+
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
406+
--argstr job "coq"
407+
- if: steps.stepCheck.outputs.status == 'built'
408+
name: Building/fetching current CI target
409+
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
410+
--argstr job "UniMath"
359411
Verdi:
360412
needs:
361413
- coq
@@ -1326,7 +1378,9 @@ jobs:
13261378
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
13271379
--argstr job "coq-lsp"
13281380
coq-performance-tests:
1329-
needs: []
1381+
needs:
1382+
- coq
1383+
- stdlib
13301384
runs-on: ubuntu-latest
13311385
steps:
13321386
- name: Determine which commit to initially checkout
@@ -1368,6 +1422,14 @@ jobs:
13681422
\ bundle \"coq-master\" --argstr job \"coq-performance-tests\" \\\n --dry-run\
13691423
\ 2>&1 > /dev/null)\necho $nb_dry_run\necho status=$(echo $nb_dry_run | grep\
13701424
\ \"built:\" | sed \"s/.*/built/\") >> $GITHUB_OUTPUT\n"
1425+
- if: steps.stepCheck.outputs.status == 'built'
1426+
name: 'Building/fetching previous CI target: coq'
1427+
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
1428+
--argstr job "coq"
1429+
- if: steps.stepCheck.outputs.status == 'built'
1430+
name: 'Building/fetching previous CI target: stdlib'
1431+
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
1432+
--argstr job "stdlib"
13711433
- if: steps.stepCheck.outputs.status == 'built'
13721434
name: Building/fetching current CI target
13731435
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"

.nix/config.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ with builtins; with (import <nixpkgs> {}).lib;
105105
"mathcomp-finmap"
106106
"mathcomp-bigenough"
107107
"mathcomp-analysis"
108-
# TODO unimath
108+
"UniMath"
109109
"unicoq"
110110
# "math-classes" -> overlay
111111
# "corn" -> overlay

.nix/coq-overlays/UniMath/default.nix

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{ lib, mkCoqDerivation, coq, version ? null }:
2+
3+
mkCoqDerivation {
4+
pname = "UniMath";
5+
owner = "UniMath";
6+
inherit version;
7+
defaultVersion = null; # no released version
8+
9+
propagatedBuildInputs = [ ];
10+
11+
preConfigure = ''
12+
for p in SubstitutionSystems Bicategories ModelCategories; do
13+
sed -i.bak "s|PACKAGES += $p||" Makefile
14+
done
15+
'';
16+
17+
buildFlags = [ "BUILD_COQ=no" ];
18+
}

0 commit comments

Comments
 (0)