Skip to content

Commit b96d434

Browse files
committed
[CI] Add test-suite
Since this is run in Coq CI, this should also be tested here.
1 parent 1b45548 commit b96d434

File tree

6 files changed

+234
-1
lines changed

6 files changed

+234
-1
lines changed

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

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -738,6 +738,62 @@ jobs:
738738
name: Building/fetching current CI target
739739
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
740740
--argstr job "hierarchy-builder"
741+
hierarchy-builder-test:
742+
needs:
743+
- coq
744+
runs-on: ubuntu-latest
745+
steps:
746+
- name: Determine which commit to initially checkout
747+
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{\
748+
\ github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha\
749+
\ }}\" >> $GITHUB_ENV\nfi\n"
750+
- name: Git checkout
751+
uses: actions/checkout@v4
752+
with:
753+
fetch-depth: 0
754+
ref: ${{ env.target_commit }}
755+
- name: Determine which commit to test
756+
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{\
757+
\ github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{\
758+
\ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge\
759+
\ | cut -f1)\n mergeable=$(git merge --no-commit --no-ff ${{ github.event.pull_request.base.sha\
760+
\ }} > /dev/null 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n\
761+
\ if [ -z \"$merge_commit\" -o \"x$mergeable\" != \"x0\" ]; then\n echo\
762+
\ \"tested_commit=${{ github.event.pull_request.head.sha }}\" >> $GITHUB_ENV\n\
763+
\ else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n fi\nfi\n"
764+
- name: Git checkout
765+
uses: actions/checkout@v4
766+
with:
767+
fetch-depth: 0
768+
ref: ${{ env.tested_commit }}
769+
- name: Cachix install
770+
uses: cachix/install-nix-action@v27
771+
with:
772+
nix_path: nixpkgs=channel:nixpkgs-unstable
773+
- name: Cachix setup math-comp
774+
uses: cachix/cachix-action@v15
775+
with:
776+
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
777+
extraPullNames: coq, coq-community
778+
name: math-comp
779+
- id: stepCheck
780+
name: Checking presence of CI target hierarchy-builder-test
781+
run: "nb_dry_run=$(NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr\
782+
\ bundle \"coq-8.18\" --argstr job \"hierarchy-builder-test\" \\\n --dry-run\
783+
\ 2>&1 > /dev/null)\necho $nb_dry_run\necho status=$(echo $nb_dry_run | grep\
784+
\ \"built:\" | sed \"s/.*/built/\") >> $GITHUB_OUTPUT\n"
785+
- if: steps.stepCheck.outputs.status == 'built'
786+
name: 'Building/fetching previous CI target: coq'
787+
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
788+
--argstr job "coq"
789+
- if: steps.stepCheck.outputs.status == 'built'
790+
name: 'Building/fetching previous CI target: coq-elpi'
791+
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
792+
--argstr job "coq-elpi"
793+
- if: steps.stepCheck.outputs.status == 'built'
794+
name: Building/fetching current CI target
795+
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.18"
796+
--argstr job "hierarchy-builder-test"
741797
http:
742798
needs:
743799
- coq

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

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -602,6 +602,62 @@ jobs:
602602
name: Building/fetching current CI target
603603
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
604604
--argstr job "hierarchy-builder"
605+
hierarchy-builder-test:
606+
needs:
607+
- coq
608+
runs-on: ubuntu-latest
609+
steps:
610+
- name: Determine which commit to initially checkout
611+
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{\
612+
\ github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha\
613+
\ }}\" >> $GITHUB_ENV\nfi\n"
614+
- name: Git checkout
615+
uses: actions/checkout@v4
616+
with:
617+
fetch-depth: 0
618+
ref: ${{ env.target_commit }}
619+
- name: Determine which commit to test
620+
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{\
621+
\ github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{\
622+
\ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge\
623+
\ | cut -f1)\n mergeable=$(git merge --no-commit --no-ff ${{ github.event.pull_request.base.sha\
624+
\ }} > /dev/null 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n\
625+
\ if [ -z \"$merge_commit\" -o \"x$mergeable\" != \"x0\" ]; then\n echo\
626+
\ \"tested_commit=${{ github.event.pull_request.head.sha }}\" >> $GITHUB_ENV\n\
627+
\ else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n fi\nfi\n"
628+
- name: Git checkout
629+
uses: actions/checkout@v4
630+
with:
631+
fetch-depth: 0
632+
ref: ${{ env.tested_commit }}
633+
- name: Cachix install
634+
uses: cachix/install-nix-action@v27
635+
with:
636+
nix_path: nixpkgs=channel:nixpkgs-unstable
637+
- name: Cachix setup math-comp
638+
uses: cachix/cachix-action@v15
639+
with:
640+
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
641+
extraPullNames: coq, coq-community
642+
name: math-comp
643+
- id: stepCheck
644+
name: Checking presence of CI target hierarchy-builder-test
645+
run: "nb_dry_run=$(NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr\
646+
\ bundle \"coq-8.19\" --argstr job \"hierarchy-builder-test\" \\\n --dry-run\
647+
\ 2>&1 > /dev/null)\necho $nb_dry_run\necho status=$(echo $nb_dry_run | grep\
648+
\ \"built:\" | sed \"s/.*/built/\") >> $GITHUB_OUTPUT\n"
649+
- if: steps.stepCheck.outputs.status == 'built'
650+
name: 'Building/fetching previous CI target: coq'
651+
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
652+
--argstr job "coq"
653+
- if: steps.stepCheck.outputs.status == 'built'
654+
name: 'Building/fetching previous CI target: coq-elpi'
655+
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
656+
--argstr job "coq-elpi"
657+
- if: steps.stepCheck.outputs.status == 'built'
658+
name: Building/fetching current CI target
659+
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.19"
660+
--argstr job "hierarchy-builder-test"
605661
http:
606662
needs:
607663
- coq

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

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -537,6 +537,62 @@ jobs:
537537
name: Building/fetching current CI target
538538
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.20"
539539
--argstr job "hierarchy-builder"
540+
hierarchy-builder-test:
541+
needs:
542+
- coq
543+
runs-on: ubuntu-latest
544+
steps:
545+
- name: Determine which commit to initially checkout
546+
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{\
547+
\ github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha\
548+
\ }}\" >> $GITHUB_ENV\nfi\n"
549+
- name: Git checkout
550+
uses: actions/checkout@v4
551+
with:
552+
fetch-depth: 0
553+
ref: ${{ env.target_commit }}
554+
- name: Determine which commit to test
555+
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{\
556+
\ github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{\
557+
\ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge\
558+
\ | cut -f1)\n mergeable=$(git merge --no-commit --no-ff ${{ github.event.pull_request.base.sha\
559+
\ }} > /dev/null 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n\
560+
\ if [ -z \"$merge_commit\" -o \"x$mergeable\" != \"x0\" ]; then\n echo\
561+
\ \"tested_commit=${{ github.event.pull_request.head.sha }}\" >> $GITHUB_ENV\n\
562+
\ else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n fi\nfi\n"
563+
- name: Git checkout
564+
uses: actions/checkout@v4
565+
with:
566+
fetch-depth: 0
567+
ref: ${{ env.tested_commit }}
568+
- name: Cachix install
569+
uses: cachix/install-nix-action@v27
570+
with:
571+
nix_path: nixpkgs=channel:nixpkgs-unstable
572+
- name: Cachix setup math-comp
573+
uses: cachix/cachix-action@v15
574+
with:
575+
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
576+
extraPullNames: coq, coq-community
577+
name: math-comp
578+
- id: stepCheck
579+
name: Checking presence of CI target hierarchy-builder-test
580+
run: "nb_dry_run=$(NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr\
581+
\ bundle \"coq-8.20\" --argstr job \"hierarchy-builder-test\" \\\n --dry-run\
582+
\ 2>&1 > /dev/null)\necho $nb_dry_run\necho status=$(echo $nb_dry_run | grep\
583+
\ \"built:\" | sed \"s/.*/built/\") >> $GITHUB_OUTPUT\n"
584+
- if: steps.stepCheck.outputs.status == 'built'
585+
name: 'Building/fetching previous CI target: coq'
586+
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.20"
587+
--argstr job "coq"
588+
- if: steps.stepCheck.outputs.status == 'built'
589+
name: 'Building/fetching previous CI target: coq-elpi'
590+
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.20"
591+
--argstr job "coq-elpi"
592+
- if: steps.stepCheck.outputs.status == 'built'
593+
name: Building/fetching current CI target
594+
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-8.20"
595+
--argstr job "hierarchy-builder-test"
540596
interval:
541597
needs:
542598
- coq

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

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,63 @@ jobs:
465465
name: Building/fetching current CI target
466466
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
467467
--argstr job "hierarchy-builder"
468+
hierarchy-builder-test:
469+
needs:
470+
- coq
471+
- coq-elpi
472+
runs-on: ubuntu-latest
473+
steps:
474+
- name: Determine which commit to initially checkout
475+
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{\
476+
\ github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha\
477+
\ }}\" >> $GITHUB_ENV\nfi\n"
478+
- name: Git checkout
479+
uses: actions/checkout@v4
480+
with:
481+
fetch-depth: 0
482+
ref: ${{ env.target_commit }}
483+
- name: Determine which commit to test
484+
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{\
485+
\ github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{\
486+
\ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge\
487+
\ | cut -f1)\n mergeable=$(git merge --no-commit --no-ff ${{ github.event.pull_request.base.sha\
488+
\ }} > /dev/null 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n\
489+
\ if [ -z \"$merge_commit\" -o \"x$mergeable\" != \"x0\" ]; then\n echo\
490+
\ \"tested_commit=${{ github.event.pull_request.head.sha }}\" >> $GITHUB_ENV\n\
491+
\ else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n fi\nfi\n"
492+
- name: Git checkout
493+
uses: actions/checkout@v4
494+
with:
495+
fetch-depth: 0
496+
ref: ${{ env.tested_commit }}
497+
- name: Cachix install
498+
uses: cachix/install-nix-action@v27
499+
with:
500+
nix_path: nixpkgs=channel:nixpkgs-unstable
501+
- name: Cachix setup math-comp
502+
uses: cachix/cachix-action@v15
503+
with:
504+
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
505+
extraPullNames: coq, coq-community
506+
name: math-comp
507+
- id: stepCheck
508+
name: Checking presence of CI target hierarchy-builder-test
509+
run: "nb_dry_run=$(NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr\
510+
\ bundle \"coq-master\" --argstr job \"hierarchy-builder-test\" \\\n --dry-run\
511+
\ 2>&1 > /dev/null)\necho $nb_dry_run\necho status=$(echo $nb_dry_run | grep\
512+
\ \"built:\" | sed \"s/.*/built/\") >> $GITHUB_OUTPUT\n"
513+
- if: steps.stepCheck.outputs.status == 'built'
514+
name: 'Building/fetching previous CI target: coq'
515+
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
516+
--argstr job "coq"
517+
- if: steps.stepCheck.outputs.status == 'built'
518+
name: 'Building/fetching previous CI target: coq-elpi'
519+
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
520+
--argstr job "coq-elpi"
521+
- if: steps.stepCheck.outputs.status == 'built'
522+
name: Building/fetching current CI target
523+
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
524+
--argstr job "hierarchy-builder-test"
468525
mathcomp:
469526
needs:
470527
- coq

.nix/config.nix

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
mathcomp.override.version = "master";
88
mathcomp.job = true;
99
mathcomp-single.job = true;
10+
hierarchy-builder-test.job = true;
1011
graph-theory.job = false;
1112
fourcolor.override.version = "master";
1213
odd-order.override.version = "master";
@@ -28,7 +29,7 @@
2829
bignums.override.version = "master";
2930
paramcoq.override.version = "master";
3031
};
31-
"coq-master".ocamlPackages = { elpi.override.version = "1.19.2"; };
32+
"coq-master".ocamlPackages = { elpi.override.version = "v1.19.5"; };
3233

3334
"coq-8.20".coqPackages = mcHBcommon // {
3435
coq.override.version = "8.20";
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{ hierarchy-builder, coqPackages }:
2+
3+
coqPackages.lib.overrideCoqDerivation {
4+
pname = "hierarchy-builder-test";
5+
6+
buildFlags = [ "test-suite" ];
7+
} hierarchy-builder

0 commit comments

Comments
 (0)