Skip to content

Commit e284970

Browse files
committed
Add the OCaml problem matcher
Signed-off-by: Sora Morimoto <sora@morimoto.io>
1 parent 53b4999 commit e284970

File tree

4 files changed

+46
-0
lines changed

4 files changed

+46
-0
lines changed

.github/ocaml.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"problemMatcher": [
3+
{
4+
"owner": "ocaml",
5+
"pattern": [
6+
{
7+
"regexp": "^File\\s\"(.+)\",\\sline\\s(\\d+),\\scharacters\\s(\\d+)-(\\d+):\\n((.|\\n)+?)(Error|Warning)\\s*(.*):\\s((.|\\n)+)$",
8+
"kind": "location",
9+
"file": 1,
10+
"line": 2,
11+
"column": 3,
12+
"endLine": 2,
13+
"endColumn": 4,
14+
"severity": 7,
15+
"code": 5,
16+
"message": 10
17+
}
18+
]
19+
}
20+
]
21+
}

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ and this project adheres to
88

99
## [unreleased]
1010

11+
### Added
12+
13+
- Add the OCaml problem matcher.
14+
1115
## [2.0.20]
1216

1317
### Changed

dist/index.js

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

packages/setup-ocaml/src/installer.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import * as path from "node:path";
33
import * as process from "node:process";
44

55
import * as core from "@actions/core";
6+
import { issueCommand } from "@actions/core/lib/command";
67
import { exec } from "@actions/exec";
78

89
import {
@@ -112,6 +113,17 @@ export async function installer() {
112113
}
113114
}
114115
}
116+
core.startGroup("Add the OCaml problem matcher");
117+
const ocamlMatcherPath = path.join(
118+
// eslint-disable-next-line unicorn/prefer-module
119+
__dirname,
120+
"..",
121+
"..",
122+
".github",
123+
"ocaml.json",
124+
);
125+
issueCommand("add-matcher", {}, ocamlMatcherPath);
126+
core.endGroup();
115127
await exec("opam", ["--version"]);
116128
if (OPAM_DEPEXT) {
117129
await exec("opam", ["depext", "--version"]);

0 commit comments

Comments
 (0)