generated from OoLunar/DSharpPlus.Template
-
-
Notifications
You must be signed in to change notification settings - Fork 2
106 lines (103 loc) · 2.72 KB
/
build-commit.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
name: Build Commit
on:
push:
paths:
- ".github/workflows/build-commit.yml"
- "benchmarks/**"
- "src/**"
- "tests/**"
- "HyperSharp.sln"
workflow_dispatch:
env:
DOTNET_NOLOGO: 1
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: 1
jobs:
build_commit:
name: Build Commit
runs-on: ubuntu-latest
if: "!contains(format('{0} {1}', github.event.head_commit.message, github.event.pull_request.title), '[ci-skip]')"
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
8
7
- name: Build Project
run: dotnet build
test_commit:
name: Test Commit
runs-on: ubuntu-latest
needs: build_commit
steps:
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
8
7
- name: Test Project
run: dotnet test
document_commit:
name: Document Commit
runs-on: ubuntu-latest
needs: test_commit
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
8
7
- name: Build Project
run: |
dotnet build
dotnet tool update -g docfx --prerelease
docfx docs/docfx.json
- name: Upload GitHub Pages artifact
uses: actions/upload-pages-artifact@v1
with:
path: ./docs/_site/
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
benchmark_commit:
name: Benchmark Commit
runs-on: ubuntu-latest
needs: test_commit
permissions:
contents: write
steps:
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
8
7
- name: Benchmark Project
run: dotnet run -c Release --project benchmarks/HyperSharp.Benchmarks.csproj --framework net8.0
- name: Output Test Results
id: test-results
run: |
body="$(cat benchmark-results.md)"
delimiter="$(openssl rand -hex 8)"
echo "body<<$delimiter" >> $GITHUB_OUTPUT
echo "$body" >> $GITHUB_OUTPUT
echo "$delimiter" >> $GITHUB_OUTPUT
- name: Comment Results
uses: peter-evans/commit-comment@v2
with:
body: ${{ steps.test-results.outputs.body }}
token: ${{ secrets.GITHUB_TOKEN }}