Skip to content

Commit 4e8bed3

Browse files
committed
Add format workflow
1 parent 642f7b9 commit 4e8bed3

6 files changed

Lines changed: 24 additions & 4 deletions

File tree

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ csharp_style_expression_bodied_operators = true
3434

3535
# Code-block preferences
3636
csharp_prefer_braces = false
37-
csharp_style_namespace_declarations = block_scoped
37+
csharp_style_namespace_declarations = file_scoped
3838

3939
#### C# Formatting Rules ####
4040

.github/workflows/Benchmark.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
name: Benchmark
22

3-
on: push
3+
on: [push, pull_request]
44
jobs:
55
Rendering:
6+
if: (github.event_name == 'pull_request') == github.event.pull_request.head.repo.fork
67
runs-on: windows-latest
78
steps:
89
- uses: actions/checkout@v6

.github/workflows/Format.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Check format
2+
3+
on: [push, pull_request]
4+
jobs:
5+
Everything:
6+
if: (github.event_name == 'pull_request') == github.event.pull_request.head.repo.fork
7+
runs-on: windows-latest
8+
steps:
9+
- uses: actions/setup-dotnet@v5
10+
with:
11+
dotnet-version: '10.x'
12+
- uses: actions/checkout@v6
13+
with:
14+
submodules: 'recursive'
15+
- name: Check formatting
16+
run: dotnet format --verify-no-changes

.github/workflows/Nightly.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
name: Upload test results and nightly builds
22

3-
on: push
3+
on: [push, pull_request]
44
jobs:
55
Everything:
6+
if: (github.event_name == 'pull_request') == github.event.pull_request.head.repo.fork
67
runs-on: windows-latest
78
steps:
89
- name: Update draft on GitHub Releases

.github/workflows/Test.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
name: Build and Test
22

3-
on: push
3+
on: [push, pull_request]
44
jobs:
55
Everything:
6+
if: (github.event_name == 'pull_request') == github.event.pull_request.head.repo.fork
67
strategy:
78
fail-fast: false # Don't cancel other os builds if one fails
89
matrix:

CSharpMath.sln

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ EndProject
5757
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{86C13BAB-EE19-4E82-B36F-2FEE92754B30}"
5858
ProjectSection(SolutionItems) = preProject
5959
.github\workflows\Benchmark.yml = .github\workflows\Benchmark.yml
60+
.github\workflows\Format.yml = .github\workflows\Format.yml
6061
.github\workflows\Nightly.yml = .github\workflows\Nightly.yml
6162
.github\workflows\Release.yml = .github\workflows\Release.yml
6263
.github\workflows\Test.yml = .github\workflows\Test.yml

0 commit comments

Comments
 (0)