Skip to content

Commit

Permalink
Add the OCaml problem matcher
Browse files Browse the repository at this point in the history
Signed-off-by: Sora Morimoto <[email protected]>
  • Loading branch information
smorimoto committed Sep 14, 2023
1 parent 53b4999 commit e053d8e
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/ocaml.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"problemMatcher": [
{
"owner": "ocaml",
"pattern": [
{
"regexp": "^File\\s\"(.*)\",\\sline\\s(\\d+),\\scharacters\\s(\\d+)-(\\d+):\\n((.|\\n)*?)(Error|Warning)\\s*(\\((.*)\\))?:\\s(.*)$",
"kind": "location",
"file": 1,
"line": 2,
"column": 3,
"endLine": 2,
"endColumn": 4,
"severity": 7,
"code": 5,
"message": 10,
"loop": true
}
]
}
]
}
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ and this project adheres to

## [unreleased]

### Added

- Add the OCaml problem matcher.

## [2.0.20]

### Changed
Expand Down
9 changes: 9 additions & 0 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions packages/setup-ocaml/src/installer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import * as path from "node:path";
import * as process from "node:process";

import * as core from "@actions/core";
import { issueCommand } from "@actions/core/lib/command";
import { exec } from "@actions/exec";

import {
Expand Down Expand Up @@ -112,6 +113,16 @@ export async function installer() {
}
}
}
core.startGroup("Add the OCaml problem matcher");
const ocamlMatcherPath = path.join(
// eslint-disable-next-line unicorn/prefer-module
__dirname,
"..",
".github",
"ocaml.json",
);
issueCommand("add-matcher", {}, ocamlMatcherPath);
core.endGroup();
await exec("opam", ["--version"]);
if (OPAM_DEPEXT) {
await exec("opam", ["depext", "--version"]);
Expand Down

0 comments on commit e053d8e

Please sign in to comment.