Skip to content

Commit

Permalink
Merge pull request #85 from nojaf/build-script
Browse files Browse the repository at this point in the history
Use build script
  • Loading branch information
nojaf authored Sep 11, 2023
2 parents 49d0dfb + 07a4005 commit 9248cac
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 27 deletions.
5 changes: 4 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,7 @@ fsharp_alternative_long_member_definitions = true
fsharp_align_function_signature_to_indentation = true
fsharp_experimental_keep_indent_in_branch = true
fsharp_bar_before_discriminated_union_declaration = true
fsharp_multiline_bracket_style = aligned
fsharp_multiline_bracket_style = aligned

[build.fsx]
fsharp_blank_lines_around_nested_multiline_expressions = false
17 changes: 1 addition & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,5 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v3

- name: Restore tools
run: dotnet tool restore

- name: Check format
run: dotnet fantomas . --check

- name: Restore dependencies
run: dotnet restore --locked-mode

- name: Build
run: dotnet build -c Release --no-restore -maxCpuCount

- name: Test
run: dotnet test -c Release --no-build

- name: RunSample
run: dotnet run --project src/FSharp.Analyzers.Cli/FSharp.Analyzers.Cli.fsproj -- --project ./samples/OptionAnalyzer/OptionAnalyzer.fsproj --analyzers-path ./samples/OptionAnalyzer/bin/Release --verbose
run: dotnet fsi build.fsx
7 changes: 2 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,8 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v3

- name: Restore tools
run: dotnet tool restore

- name: Run Build
run: dotnet build -c Release -maxCpuCount
- name: Run Release Build
run: dotnet fsi build.fsx -p ReleaseBuild

- name: Get Changelog Entry
id: changelog_reader
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,7 @@ FodyWeavers.xsd

# JetBrains Rider
*.sln.iml
.idea

### VisualStudio Patch ###
# Additional files built by Visual Studio
Expand Down
7 changes: 2 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,10 @@ in order to craft an excellent pull request:
[interactive rebase](https://help.github.com/articles/about-git-rebase/)
feature to tidy up your commits before making them public.

5. Ensure the code is formatted and the sample still works.
5. Ensure the CI build passes locally.

```bash
dotnet tool restore
dotnet fantomas .
dotnet build -c Release
dotnet run --project src/FSharp.Analyzers.Cli/FSharp.Analyzers.Cli.fsproj -- --project ./samples/OptionAnalyzer/OptionAnalyzer.fsproj --analyzers-path ./samples/OptionAnalyzer/bin/Release --verbose
dotnet fsi build.fsx
```

6. Push your topic branch up to your fork:
Expand Down
32 changes: 32 additions & 0 deletions build.fsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#r "nuget: Fun.Build, 0.5.2"

open Fun.Build

let restoreStage =
stage "restore" {
run "dotnet tool restore"
run "dotnet restore --locked-mode"
}

let buildStage =
stage "build" { run "dotnet build -c Release --no-restore -maxCpuCount" }

pipeline "Build" {
restoreStage
stage "lint" { run "dotnet fantomas . --check" }
stage "build" { run "dotnet build -c Release --no-restore -maxCpuCount" }
stage "test" { run "dotnet test -c Release --no-build" }
stage "sample" {
run
"dotnet run --project src/FSharp.Analyzers.Cli/FSharp.Analyzers.Cli.fsproj -- --project ./samples/OptionAnalyzer/OptionAnalyzer.fsproj --analyzers-path ./samples/OptionAnalyzer/bin/Release --verbose"
}
runIfOnlySpecified false
}

pipeline "ReleaseBuild" {
restoreStage
buildStage
runIfOnlySpecified true
}

tryPrintPipelineCommandHelp ()

0 comments on commit 9248cac

Please sign in to comment.