Skip to content

Commit 6f0cccf

Browse files
authored
feat: Include dafny-reportgenerator as well (#8)
1 parent b76470d commit 6f0cccf

4 files changed

Lines changed: 33 additions & 1 deletion

File tree

.github/workflows/main.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,19 @@ jobs:
3636
run: __tests__/verify-dafny.sh ${{ matrix.dafny }}
3737

3838
- name: verify something with dafny
39+
if: ${{ !(matrix.dafny != '2.3.0' && matrix.dafny != '3.0.0') }}
3940
shell: bash
40-
run: dafny /compile:0 __tests__/test.dfy
41+
run: dafny /compile:0 __tests__/test.dfy
42+
43+
- name: verify something with dafny (with verification logging)
44+
if: matrix.dafny != '2.3.0' && matrix.dafny != '3.0.0'
45+
shell: bash
46+
run: dafny /compile:0 __tests__/test.dfy /verificationLogger:csv
47+
48+
- name: Run the reportgenerator
49+
shell: bash
50+
# This will find no results if we didn't run with verification logging on above
51+
run: dafny-reportgenerator summarize-csv-results --max-resource-count 900000 .
4152

4253
unit-tests:
4354
name: Run tests

dist/index.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6688,6 +6688,7 @@ var __webpack_exports__ = {};
66886688
var exports = __webpack_exports__;
66896689
const core = __nccwpck_require__(2186);
66906690
const tc = __nccwpck_require__(7784);
6691+
const exec = __nccwpck_require__(1514);
66916692
const os = __nccwpck_require__(2037);
66926693

66936694
(async function () {
@@ -6705,11 +6706,20 @@ const os = __nccwpck_require__(2037);
67056706
const cachedPath = await tc.cacheDir(dir + "/dafny", "dafny", version);
67066707

67076708
core.addPath(cachedPath);
6709+
6710+
// Install related tools.
6711+
// Hopefully in the future we can install Dafny itself this way as well.
6712+
// For now the zipped releases are simpler because they include Z3.
6713+
await installDotnetTool("dafny-reportgenerator", "1.*")
67086714
} catch (error) {
67096715
core.setFailed(error.message);
67106716
}
67116717
})();
67126718

6719+
async function installDotnetTool(toolName, version) {
6720+
await exec.exec("dotnet", ["tool", "install", "-g", toolName, "--version", version])
6721+
}
6722+
67136723
// Export functions for testing
67146724
exports.dafnyURL = dafnyURL;
67156725
exports.getDistribution = getDistribution;

index.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const core = require("@actions/core");
22
const tc = require("@actions/tool-cache");
3+
const exec = require("@actions/exec");
34
const os = require("os");
45

56
(async function () {
@@ -17,11 +18,20 @@ const os = require("os");
1718
const cachedPath = await tc.cacheDir(dir + "/dafny", "dafny", version);
1819

1920
core.addPath(cachedPath);
21+
22+
// Install related tools.
23+
// Hopefully in the future we can install Dafny itself this way as well.
24+
// For now the zipped releases are simpler because they include Z3.
25+
await installDotnetTool("dafny-reportgenerator", "1.*")
2026
} catch (error) {
2127
core.setFailed(error.message);
2228
}
2329
})();
2430

31+
async function installDotnetTool(toolName, version) {
32+
await exec.exec("dotnet", ["tool", "install", "-g", toolName, "--version", version])
33+
}
34+
2535
// Export functions for testing
2636
exports.dafnyURL = dafnyURL;
2737
exports.getDistribution = getDistribution;

package-lock.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)