Skip to content

Commit 9a9113a

Browse files
committed
WIP performance test
1 parent 81de981 commit 9a9113a

File tree

3 files changed

+69
-1
lines changed

3 files changed

+69
-1
lines changed

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

+47
Original file line numberDiff line numberDiff line change
@@ -1325,6 +1325,53 @@ jobs:
13251325
name: Building/fetching current CI target
13261326
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
13271327
--argstr job "coq-lsp"
1328+
coq-performance-tests:
1329+
needs: []
1330+
runs-on: ubuntu-latest
1331+
steps:
1332+
- name: Determine which commit to initially checkout
1333+
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{\
1334+
\ github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha\
1335+
\ }}\" >> $GITHUB_ENV\nfi\n"
1336+
- name: Git checkout
1337+
uses: actions/checkout@v3
1338+
with:
1339+
fetch-depth: 0
1340+
ref: ${{ env.target_commit }}
1341+
- name: Determine which commit to test
1342+
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{\
1343+
\ github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{\
1344+
\ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge\
1345+
\ | cut -f1)\n mergeable=$(git merge --no-commit --no-ff ${{ github.event.pull_request.base.sha\
1346+
\ }} > /dev/null 2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n\
1347+
\ if [ -z \"$merge_commit\" -o \"x$mergeable\" != \"x0\" ]; then\n echo\
1348+
\ \"tested_commit=${{ github.event.pull_request.head.sha }}\" >> $GITHUB_ENV\n\
1349+
\ else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n fi\nfi\n"
1350+
- name: Git checkout
1351+
uses: actions/checkout@v3
1352+
with:
1353+
fetch-depth: 0
1354+
ref: ${{ env.tested_commit }}
1355+
- name: Cachix install
1356+
uses: cachix/install-nix-action@v27
1357+
with:
1358+
nix_path: nixpkgs=channel:nixpkgs-unstable
1359+
- name: Cachix setup coq-community
1360+
uses: cachix/cachix-action@v15
1361+
with:
1362+
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
1363+
extraPullNames: coq, math-comp
1364+
name: coq-community
1365+
- id: stepCheck
1366+
name: Checking presence of CI target coq-performance-tests
1367+
run: "nb_dry_run=$(NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr\
1368+
\ bundle \"coq-master\" --argstr job \"coq-performance-tests\" \\\n --dry-run\
1369+
\ 2>&1 > /dev/null)\necho $nb_dry_run\necho status=$(echo $nb_dry_run | grep\
1370+
\ \"built:\" | sed \"s/.*/built/\") >> $GITHUB_OUTPUT\n"
1371+
- if: steps.stepCheck.outputs.status == 'built'
1372+
name: Building/fetching current CI target
1373+
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master"
1374+
--argstr job "coq-performance-tests"
13281375
coq-tools:
13291376
needs:
13301377
- coq

.nix/config.nix

+2-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ with builtins; with (import <nixpkgs> {}).lib;
115115
"iris-examples"
116116
# "coq-hammer" -> overlay
117117
# "flocq" -> overlay
118-
# TODO coq-performance-tests
118+
# "coq-performance-tests" -> overlay
119119
# "coq-tools" -> overlay
120120
"coquelicot"
121121
# "compcert" -> overlay
@@ -228,6 +228,7 @@ with builtins; with (import <nixpkgs> {}).lib;
228228
neural-net-coq-interp.override.version = "proux01:split_stdlib";
229229
engine-bench.override.version = "proux01:split_stdlib";
230230
coq-tools.override.version = "proux01:split_stdlib";
231+
coq-performance-tests.override.version = "proux01:split_stdlib";
231232
};
232233
in {
233234
"coq-master".coqPackages = common-bundles // {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{ lib, time, mkCoqDerivation, coq, stdlib, version ? null }:
2+
3+
mkCoqDerivation {
4+
pname = "coq-performance-tests";
5+
owner = "coq-community";
6+
inherit version;
7+
defaultVersion = null; # no released version
8+
9+
nativeBuildInputs = [ time ];
10+
propagatedBuildInputs = [ stdlib ];
11+
12+
preConfigure = ''
13+
for f in $(find . -name "*.sh") ; do patchShebangs $f ; done
14+
'';
15+
16+
buildPhase = ''
17+
make coq perf-Sanity
18+
make validate
19+
'';
20+
}

0 commit comments

Comments
 (0)