-
-
Notifications
You must be signed in to change notification settings - Fork 194
92 lines (88 loc) · 3.36 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: Build main
on: [push, pull_request]
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
jobs:
build:
continue-on-error: true
strategy:
matrix:
os: [ubuntu-latest] # [ubuntu-latest, windows-latest, macOS-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
- name: Build Client
run: dotnet build ./src/Fantomas.Client/
# - name: Init
# run: dotnet fsi build.fsx -p Init
# - name: Build
# run: dotnet fsi build.fsx
# - name: Benchmark
# run: dotnet fsi build.fsx -p Benchmark
# - name: "trigger fantomas-tools action"
# if: matrix.os == 'ubuntu-latest' && github.ref == 'refs/heads/main'
# run: "curl -H 'Accept: application/vnd.github.everest-preview+json' -H 'Authorization: token ${{secrets.FANTOMAS_TOOLS_TOKEN}}' --request POST --data '{\"event_type\": \"fantomas-commit-on-main\"}' https://api.github.com/repos/fsprojects/fantomas-tools/dispatches"
- name: Analyzers results
uses: actions/github-script@v6
if: matrix.os == 'ubuntu-latest'
with:
script: |
const { cwd } = require('node:process');
const repositoryRoot = cwd();
const path = require("path");
const analysisPath = path.join(repositoryRoot, "analysis.json");
const { existsSync } = require("node:fs");
if (!existsSync(analysisPath)) {
console.log(`No F# analyzer report was found at ${analysisPath}`);
} else {
const analysisResult = require(analysisPath);
analysisResult.messages.forEach(({ type, code, message, severity, range, fileName }) => {
switch(severity) {
case "info":
core.notice(code, {
title:type,
file: fileName,
startLine: range.startLine,
startColumn: range.startColumn,
endLine: range.endLine,
endColumn: range.endColumn
});
break;
case "warning":
core.warning(code, {
title:type,
file: fileName,
startLine: range.startLine,
startColumn: range.startColumn,
endLine: range.endLine,
endColumn: range.endColumn
});
break;
case "error":
core.error(code, {
title:type,
file: fileName,
startLine: range.startLine,
startColumn: range.startColumn,
endLine: range.endLine,
endColumn: range.endColumn
});
break;
}
});
}
- name: "Documentation"
if: matrix.os == 'windows-latest' && github.ref == 'refs/heads/main'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./output
- name: "Publish"
if: matrix.os == 'windows-latest' && github.ref == 'refs/heads/main'
env:
NUGET_KEY: ${{ secrets.NUGET_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: dotnet fsi build.fsx -p Release