Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# [Choice] Debian version (use bullseye on local arm64/Apple Silicon): bookworm, bullseye, buster
ARG VARIANT="bookworm"
FROM buildpack-deps:${VARIANT}-curl


ENV \
# Enable detection of running in a container
DOTNET_RUNNING_IN_CONTAINER=true \
DOTNET_ROOT=/usr/share/dotnet/ \
DOTNET_NOLOGO=true \
DOTNET_CLI_TELEMETRY_OPTOUT=false\
DOTNET_USE_POLLING_FILE_WATCHER=true


# [Optional] Uncomment this section to install additional OS packages.
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# && apt-get -y install --no-install-recommends <your-package-list-here>
71 changes: 71 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{
"name": "dotnet",
// Set the build context one level higher so we can grab metadata like global.json
"context": "..",
"dockerFile": "Dockerfile",
"forwardPorts": [
0
],
"features": {
// https://github.com/devcontainers/features/blob/main/src/common-utils/README.md
"ghcr.io/devcontainers/features/common-utils:2": {
"installZsh": true,
"installOhMyZshConfig": true,
"configureZshAsDefaultShell": true,
"username": "vscode",
"userUid": "1000",
"userGid": "1000",
"upgradePackages": true
},
// https://github.com/devcontainers/features/blob/main/src/github-cli/README.md
"ghcr.io/devcontainers/features/github-cli:1": {},
// https://github.com/devcontainers-contrib/features/blob/main/src/starship/README.md
"ghcr.io/devcontainers-contrib/features/starship:1": {},
// https://github.com/devcontainers/features/blob/main/src/dotnet/README.md
"ghcr.io/devcontainers/features/dotnet:2": {
"version": "9.0.201"
}
},
"overrideFeatureInstallOrder": [
"ghcr.io/devcontainers/features/common-utils",
"ghcr.io/devcontainers/features/github-cli",
"ghcr.io/devcontainers-contrib/features/starship",
"ghcr.io/devcontainers/features/dotnet"
],
"customizations": {
"vscode": {
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"ms-dotnettools.csharp",
"Ionide.Ionide-fsharp",
"tintoy.msbuild-project-tools",
"ionide.ionide-paket",
"usernamehw.errorlens",
"alefragnani.Bookmarks",
"oderwat.indent-rainbow",
"vscode-icons-team.vscode-icons",
"EditorConfig.EditorConfig",
"GitHub.vscode-pull-request-github",
"github.vscode-github-actions"
],
"settings": {
"terminal.integrated.defaultProfile.linux": "zsh",
"csharp.suppressDotnetInstallWarning": true
}
}
},
"remoteUser": "vscode",
"containerUser": "vscode",
"containerEnv": {
// Expose the local environment variable to the container
// They are used for releasing and publishing from the container
"GITHUB_TOKEN": "${localEnv:GITHUB_TOKEN}"
},
"onCreateCommand": {
"enable-starship": "echo 'eval \"$(starship init zsh)\"' >> ~/.zshrc"
},
"postAttachCommand": {
"restore": "dotnet tool restore && dotnet restore"
},
"waitFor": "updateContentCommand"
}
58 changes: 28 additions & 30 deletions .github/workflows/build+test+deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,14 @@ jobs:
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet fsi build.fsx -t Build
shell: pwsh
run: ./build.ps1 DotnetBuild
- name: Run tests
run: dotnet fsi build.fsx -t Test
shell: pwsh
run: ./build.ps1 DotnetTest
- name: Run FSharpLint on itself
run: dotnet fsi build.fsx -t SelfCheck
shell: pwsh
run: ./build.ps1 SelfCheck


deployReleaseBinaries:
Expand All @@ -56,46 +59,40 @@ jobs:
- name: Restore tools
run: dotnet tool restore
- name: Build
run: dotnet fsi build.fsx
shell: pwsh
run: ./build.ps1
- name: Pack
run: dotnet fsi build.fsx -t Pack
shell: pwsh
run: ./build.ps1 DotnetPack
- name: Publish binaries as artifact
uses: actions/upload-artifact@v4
with:
name: binaries
path: ./out/*.nupkg
path: ./dist/*.nupkg
- name: Get Changelog Entry
id: changelog_reader
uses: mindsers/changelog-reader-action@v1
with:
version: ${{ github.ref }}
path: ./CHANGELOG.md
- name: Upload binaries to nuget (if nugetKey present)
- name: Publish (if tag)
if: startsWith(github.ref, 'refs/tags/')
shell: pwsh
env:
nuget-key: ${{ secrets.NUGET_KEY }}
NUGET_TOKEN: ${{ secrets.NUGET_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: dotnet fsi build.fsx -t Push
- name: Create Release (if tag)
if: startsWith(github.ref, 'refs/tags/')
id: create_release
uses: actions/create-release@latest
FAKE_DETAILED_ERRORS: true

run: ./build.ps1 Publish

- name: PublishToGitHub (if master branch)
if: github.ref == 'refs/heads/master'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xperiandri this logic was moved in the past from GithubActions to F#, let's keep it in F# please

shell: pwsh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
body: ${{ steps.changelog_reader.outputs.log_entry }}
draft: false
prerelease: false
- name: Upload binaries to release (if tag)
if: startsWith(github.ref, 'refs/tags/')
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: out/*.nupkg
tag: ${{ github.ref }}
overwrite: true
file_glob: true
NUGET_TOKEN: ${{ secrets.NUGET_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
FAKE_DETAILED_ERRORS: true
run: ./build.ps1 PublishToGitHub


deployReleaseDocs:
Expand All @@ -114,7 +111,8 @@ jobs:
- name: Restore dependencies
run: dotnet restore
- name: Run Fornax
run: dotnet fsi build.fsx -t Docs
shell: pwsh
run: ./build.ps1 BuildDocs
- name: Deploy (if tag)
if: startsWith(github.ref, 'refs/tags/')
uses: peaceiris/actions-gh-pages@v3
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ x86/
[Ww][Ii][Nn]32/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
build/
bld/
[Bb]in/
[Oo]bj/
Expand Down
8 changes: 8 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"recommendations": [
"ionide.ionide-fsharp",
"ionide.ionide-fake",
"ms-dotnettools.csharp",
"editorConfig.editorConfig"
]
}
7 changes: 7 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"FSharp.fsacRuntime":"netcore",
"FSharp.enableAnalyzers": false,
"FSharp.analyzersPath": [
"./packages/analyzers"
]
}
26 changes: 22 additions & 4 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
<ItemGroup>
<ItemGroup Label="Main">
<PackageVersion Include="Argu" Version="6.2.5" />
<PackageVersion Include="BenchmarkDotNet" Version="0.15.2" />
<PackageVersion Include="BenchmarkDotNet.Diagnostics.Windows" Version="0.15.2" />
Expand All @@ -14,16 +14,34 @@
<PackageVersion Include="Ionide.ProjInfo.ProjectSystem" Version="0.70.2" />
<PackageVersion Include="Ionide.ProjInfo.FCS" Version="0.70.2" />
<PackageVersion Include="Ionide.ProjInfo" Version="0.70.2" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
<PackageVersion Include="Microsoft.Build" Version="17.14.8" />
<PackageVersion Include="Microsoft.Build.Locator" Version="1.9.1" />
<PackageVersion Include="Microsoft.Build.Framework" Version="17.14.8" />
<PackageVersion Include="Microsoft.Build.Tasks.Core" Version="17.14.8" />
<PackageVersion Include="Microsoft.Build.Utilities.Core" Version="17.14.8" />
<PackageVersion Include="System.Reactive" Version="6.0.1" />
<PackageVersion Include="System.Text.Json" Version="9.0.0" />
</ItemGroup>
<ItemGroup Label="Build and Test">
<PackageVersion Include="altcover" Version="9.0.1" />
<PackageVersion Include="Fake.Api.GitHub" Version="6.1.3" />
<PackageVersion Include="Fake.BuildServer.GitHubActions" Version="6.1.3" />
<PackageVersion Include="Fake.Core.Environment" Version="6.1.3" />
<PackageVersion Include="Fake.Core.Process" Version="6.1.3" />
<PackageVersion Include="Fake.Core.ReleaseNotes" Version="6.1.3" />
<PackageVersion Include="Fake.Core.Target" Version="6.1.3" />
<PackageVersion Include="Fake.DotNet.AssemblyInfoFile" Version="6.1.3" />
<PackageVersion Include="Fake.DotNet.Cli" Version="6.1.3" />
<PackageVersion Include="Fake.DotNet.Paket" Version="6.1.3" />
<PackageVersion Include="Fake.IO.FileSystem" Version="6.1.3" />
<PackageVersion Include="Fake.Tools.Git" Version="6.1.3" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
<PackageVersion Include="MSBuild.StructuredLogger" Version="2.3.17" />
<PackageVersion Include="NuGet.Common" Version="6.14.0" />
<PackageVersion Include="NuGet.Protocol" Version="6.14.0" />
<PackageVersion Include="NUnit" Version="3.14.0" />
<PackageVersion Include="NUnit3TestAdapter" Version="5.0.0" />
<PackageVersion Include="System.Reactive" Version="6.0.1" />
<PackageVersion Include="System.Text.Json" Version="9.0.0" />
<PackageVersion Include="Unquote" Version="7.0.1" />
</ItemGroup>
</Project>
13 changes: 13 additions & 0 deletions FSharpLint.slnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"solution": {
"path": "FSharpLint.slnx",
"projects": [
"src\\FSharpLint.Console\\FSharpLint.Console.fsproj",
"src\\FSharpLint.Core\\FSharpLint.Core.fsproj",
"tests\\FSharpLint.Benchmarks\\FSharpLint.Benchmarks.fsproj",
"tests\\FSharpLint.Console.Tests\\FSharpLint.Console.Tests.fsproj",
"tests\\FSharpLint.Core.Tests\\FSharpLint.Core.Tests.fsproj",
"tests\\FSharpLint.FunctionalTest\\FSharpLint.FunctionalTest.fsproj"
]
}
}
2 changes: 1 addition & 1 deletion FSharpLint.slnx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
<Platform Name="x86" />
</Configurations>
<Folder Name="/Solution Items/">
<File Path="build.fsx" />
<File Path="CHANGELOG.md" />
<File Path="Directory.Build.props" />
<File Path="Directory.Packages.props" />
Expand Down Expand Up @@ -105,4 +104,5 @@
<Project Path="tests/FSharpLint.Core.Tests/FSharpLint.Core.Tests.fsproj" />
<Project Path="tests/FSharpLint.FunctionalTest/FSharpLint.FunctionalTest.fsproj" />
</Folder>
<Project Path="build/build.fsproj" />
</Solution>
1 change: 1 addition & 0 deletions build.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dotnet run --project ./build/build.fsproj -- --target %*
Loading
Loading