Skip to content

Commit 99adb51

Browse files
committed
Merge branch 'master' into v1
2 parents 31648d0 + a6f36cf commit 99adb51

File tree

8 files changed

+249
-91
lines changed

8 files changed

+249
-91
lines changed

.github/crystal-spec.json

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
"problemMatcher": [
3+
{
4+
"owner": "crystal-spec-multi-line",
5+
"pattern": [
6+
{
7+
"regexp": "^ {0,2}\\d+\\) (.+)$"
8+
},
9+
{
10+
"regexp": "^ {5}(.+)$"
11+
},
12+
{
13+
"regexp": "^$"
14+
},
15+
{
16+
"regexp": "^ {5}\\s*(.+)$"
17+
},
18+
{
19+
"regexp": "^ {5}\\s*(.+)$",
20+
"message": 1
21+
},
22+
{
23+
"regexp": "^$"
24+
},
25+
{
26+
"regexp": "^ {5}# (.+):(\\d+)$",
27+
"file": 1,
28+
"line": 2
29+
}
30+
]
31+
},
32+
{
33+
"owner": "crystal-spec-single-line",
34+
"pattern": [
35+
{
36+
"regexp": "^ {0,2}\\d+\\) (.+)$"
37+
},
38+
{
39+
"regexp": "^ {5}(.+)$"
40+
},
41+
{
42+
"regexp": "^$"
43+
},
44+
{
45+
"regexp": "^ {5}\\s*(.+)$",
46+
"message": 1
47+
},
48+
{
49+
"regexp": "^$"
50+
},
51+
{
52+
"regexp": "^ {5}# ([^\\s]+):(\\d+)$",
53+
"file": 1,
54+
"line": 2
55+
}
56+
]
57+
}
58+
]
59+
}

.github/crystal.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"problemMatcher": [
3+
{
4+
"owner": "crystal",
5+
"pattern": [
6+
{
7+
"regexp": "^In (\\x1b\\[[0-9;]+m)?(.+):(\\d+):(\\d+)",
8+
"file": 2,
9+
"line": 3,
10+
"column": 4
11+
},
12+
{
13+
"regexp": "^$"
14+
},
15+
{
16+
"regexp": "^.+$"
17+
},
18+
{
19+
"regexp": "^.+$"
20+
},
21+
{
22+
"regexp": "^(\\x1b\\[[0-9;]+m)?(Error|Warning): (.+)$",
23+
"severity": 2,
24+
"message": 3
25+
}
26+
]
27+
}
28+
]
29+
}

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@ Alternatively, you can use the container-based approach [as in the starter workf
9797

9898
The directory to store Crystal in, after extracting. Will directly affect `outputs.path` (the default is in a temporary location).
9999

100+
* **`annotate: true`** (default)
101+
102+
Display compilation and spec errors as GitHub code annotations.
103+
100104
* **`token: ${{ github.token }}`**
101105

102106
Personal access token (auto-populated).

action.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ inputs:
99
description: The architecture of the build of Crystal ("x86_64")
1010
destination:
1111
description: The directory to store Crystal in
12+
annotate:
13+
description: Display compilation and spec errors as GitHub code annotations
14+
default: true
1215
token:
1316
description: Personal access token (auto-populated)
1417
default: ${{ github.token }}

docs/configurator.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ Set up your Crystal project on GitHub for continuous testing.
3333
<p>Add this content to your GitHub repository as <code>.github/workflows/ci.yml</code>:</p>
3434

3535
```yaml
36+
# This CI job installs Crystal and shard dependencies, then executes `crystal spec` to run the test suite
37+
# More configuration options are available at https://crystal-lang.github.io/install-crystal/configurator.html
38+
3639
on:
3740
push:
3841
pull_request:
@@ -53,7 +56,7 @@ jobs:
5356
- os: ubuntu-latest
5457
{%- if crystal_ver %}
5558
- os: ubuntu-latest
56-
crystal: 0.35.1
59+
crystal: 1.0.0
5760
{%- endif %}
5861
{%- if crystal_nightly %}
5962
- os: ubuntu-latest
@@ -70,7 +73,7 @@ jobs:
7073
os: [ubuntu-latest{% if os_mac %}, macos-latest{% endif %}{% if os_win %}, windows-latest{% endif %}]
7174
{%- endif %}
7275
{%- if crystal_nightly or crystal_ver %}
73-
crystal: [{% if crystal_ver %}0.35.1, {% endif %}latest{% if crystal_nightly %}, nightly{% endif %}]
76+
crystal: [{% if crystal_ver %}1.0.0, {% endif %}latest{% if crystal_nightly %}, nightly{% endif %}]
7477
{%- endif %}
7578
{%- endif %}
7679
{%- endif %}

index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@ async function run() {
4747

4848
const {stdout} = await subprocess(["crystal", "--version"]);
4949
Core.info(stdout);
50+
51+
if (Core.getBooleanInput("annotate")) {
52+
const matchersPath = Path.join(__dirname, ".github");
53+
Core.info(`::add-matcher::${Path.join(matchersPath, "crystal.json")}`);
54+
Core.info(`::add-matcher::${Path.join(matchersPath, "crystal-spec.json")}`);
55+
}
5056
} catch (error) {
5157
Core.setFailed(error);
5258
process.exit(1);

0 commit comments

Comments
 (0)