Skip to content

Commit f4e59b2

Browse files
committed
feat(ci): Fake build project
1 parent b173d9f commit f4e59b2

19 files changed

+1434
-323
lines changed

.devcontainer/Dockerfile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# [Choice] Debian version (use bullseye on local arm64/Apple Silicon): bookworm, bullseye, buster
2+
ARG VARIANT="bookworm"
3+
FROM buildpack-deps:${VARIANT}-curl
4+
5+
6+
ENV \
7+
# Enable detection of running in a container
8+
DOTNET_RUNNING_IN_CONTAINER=true \
9+
DOTNET_ROOT=/usr/share/dotnet/ \
10+
DOTNET_NOLOGO=true \
11+
DOTNET_CLI_TELEMETRY_OPTOUT=false\
12+
DOTNET_USE_POLLING_FILE_WATCHER=true
13+
14+
15+
# [Optional] Uncomment this section to install additional OS packages.
16+
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
17+
# && apt-get -y install --no-install-recommends <your-package-list-here>

.devcontainer/devcontainer.json

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
{
2+
"name": "dotnet",
3+
// Set the build context one level higher so we can grab metadata like global.json
4+
"context": "..",
5+
"dockerFile": "Dockerfile",
6+
"forwardPorts": [
7+
0
8+
],
9+
"features": {
10+
// https://github.com/devcontainers/features/blob/main/src/common-utils/README.md
11+
"ghcr.io/devcontainers/features/common-utils:2": {
12+
"installZsh": true,
13+
"installOhMyZshConfig": true,
14+
"configureZshAsDefaultShell": true,
15+
"username": "vscode",
16+
"userUid": "1000",
17+
"userGid": "1000",
18+
"upgradePackages": true
19+
},
20+
// https://github.com/devcontainers/features/blob/main/src/github-cli/README.md
21+
"ghcr.io/devcontainers/features/github-cli:1": {},
22+
// https://github.com/devcontainers-contrib/features/blob/main/src/starship/README.md
23+
"ghcr.io/devcontainers-contrib/features/starship:1": {},
24+
// https://github.com/devcontainers/features/blob/main/src/dotnet/README.md
25+
"ghcr.io/devcontainers/features/dotnet:2": {
26+
"version": "9.0.201"
27+
}
28+
},
29+
"overrideFeatureInstallOrder": [
30+
"ghcr.io/devcontainers/features/common-utils",
31+
"ghcr.io/devcontainers/features/github-cli",
32+
"ghcr.io/devcontainers-contrib/features/starship",
33+
"ghcr.io/devcontainers/features/dotnet"
34+
],
35+
"customizations": {
36+
"vscode": {
37+
// Add the IDs of extensions you want installed when the container is created.
38+
"extensions": [
39+
"ms-dotnettools.csharp",
40+
"Ionide.Ionide-fsharp",
41+
"tintoy.msbuild-project-tools",
42+
"ionide.ionide-paket",
43+
"usernamehw.errorlens",
44+
"alefragnani.Bookmarks",
45+
"oderwat.indent-rainbow",
46+
"vscode-icons-team.vscode-icons",
47+
"EditorConfig.EditorConfig",
48+
"GitHub.vscode-pull-request-github",
49+
"github.vscode-github-actions"
50+
],
51+
"settings": {
52+
"terminal.integrated.defaultProfile.linux": "zsh",
53+
"csharp.suppressDotnetInstallWarning": true
54+
}
55+
}
56+
},
57+
"remoteUser": "vscode",
58+
"containerUser": "vscode",
59+
"containerEnv": {
60+
// Expose the local environment variable to the container
61+
// They are used for releasing and publishing from the container
62+
"GITHUB_TOKEN": "${localEnv:GITHUB_TOKEN}"
63+
},
64+
"onCreateCommand": {
65+
"enable-starship": "echo 'eval \"$(starship init zsh)\"' >> ~/.zshrc"
66+
},
67+
"postAttachCommand": {
68+
"restore": "dotnet tool restore && dotnet restore"
69+
},
70+
"waitFor": "updateContentCommand"
71+
}

.github/workflows/build+test+deploy.yml

Lines changed: 23 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ on:
1414
branches:
1515
- '**'
1616

17-
env:
18-
DOTNET_VERSION: 9.0.201
19-
2017
jobs:
2118
buildAndTest:
2219

@@ -33,17 +30,20 @@ jobs:
3330
- name: Setup .NET
3431
uses: actions/setup-dotnet@v4
3532
with:
36-
dotnet-version: ${{ env.DOTNET_VERSION }}
33+
global-json-file: global.json
3734
- name: Restore tools
3835
run: dotnet tool restore
3936
- name: Restore dependencies
4037
run: dotnet restore
4138
- name: Build
42-
run: dotnet fsi build.fsx -t Build
39+
shell: pwsh
40+
run: ./build.ps1 DotnetBuild
4341
- name: Run tests
44-
run: dotnet fsi build.fsx -t Test
42+
shell: pwsh
43+
run: ./build.ps1 DotnetTest
4544
- name: Run FSharpLint on itself
46-
run: dotnet fsi build.fsx -t SelfCheck
45+
shell: pwsh
46+
run: ./build.ps1 SelfCheck
4747

4848

4949
deployReleaseBinaries:
@@ -55,45 +55,30 @@ jobs:
5555
- name: Setup .NET
5656
uses: actions/setup-dotnet@v4
5757
with:
58-
dotnet-version: ${{ env.DOTNET_VERSION }}
58+
global-json-file: global.json
5959
- name: Restore tools
6060
run: dotnet tool restore
6161
- name: Build
62-
run: dotnet fsi build.fsx
62+
shell: pwsh
63+
run: ./build.ps1
6364
- name: Pack
64-
run: dotnet fsi build.fsx -t Pack
65+
shell: pwsh
66+
run: ./build.ps1 DotnetPack
6567
- name: Get Changelog Entry
6668
id: changelog_reader
6769
uses: mindsers/changelog-reader-action@v1
6870
with:
6971
version: ${{ github.ref }}
7072
path: ./CHANGELOG.md
71-
- name: Upload binaries to nuget (if nugetKey present)
72-
env:
73-
nuget-key: ${{ secrets.NUGET_KEY }}
74-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
75-
run: dotnet fsi build.fsx -t Push
76-
- name: Create Release (if tag)
77-
if: startsWith(github.ref, 'refs/tags/')
78-
id: create_release
79-
uses: actions/create-release@latest
80-
env:
81-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
82-
with:
83-
tag_name: ${{ github.ref }}
84-
release_name: ${{ github.ref }}
85-
body: ${{ steps.changelog_reader.outputs.log_entry }}
86-
draft: false
87-
prerelease: false
88-
- name: Upload binaries to release (if tag)
73+
- name: Publish (if tag)
8974
if: startsWith(github.ref, 'refs/tags/')
90-
uses: svenstaro/upload-release-action@v2
91-
with:
92-
repo_token: ${{ secrets.GITHUB_TOKEN }}
93-
file: out/*.nupkg
94-
tag: ${{ github.ref }}
95-
overwrite: true
96-
file_glob: true
75+
shell: pwsh
76+
run: ./build.ps1 Publish
77+
78+
- name: PublishToGitHub (if master branch)
79+
if: github.ref == 'refs/heads/master'
80+
shell: pwsh
81+
run: ./build.ps1 PublishToGitHub
9782

9883

9984
deployReleaseDocs:
@@ -105,14 +90,15 @@ jobs:
10590
- name: Setup .NET
10691
uses: actions/setup-dotnet@v4
10792
with:
108-
dotnet-version: ${{ env.DOTNET_VERSION }}
93+
global-json-file: global.json
10994

11095
- name: Restore tools
11196
run: dotnet tool restore
11297
- name: Restore dependencies
11398
run: dotnet restore
11499
- name: Run Fornax
115-
run: dotnet fsi build.fsx -t Docs
100+
shell: pwsh
101+
run: ./build.ps1 BuildDocs
116102
- name: Deploy (if tag)
117103
if: startsWith(github.ref, 'refs/tags/')
118104
uses: peaceiris/actions-gh-pages@v3
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: "Copilot Setup Steps"
2+
3+
# Automatically run the setup steps when they are changed to allow for easy validation, and
4+
# allow manual testing through the repository's "Actions" tab
5+
on:
6+
workflow_dispatch:
7+
push:
8+
paths:
9+
- .github/workflows/copilot-setup-steps.yml
10+
pull_request:
11+
paths:
12+
- .github/workflows/copilot-setup-steps.yml
13+
14+
jobs:
15+
# The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot.
16+
copilot-setup-steps:
17+
runs-on: windows-2025
18+
19+
# Set the permissions to the lowest permissions possible needed for your steps.
20+
# Copilot will be given its own token for its operations.
21+
permissions:
22+
# If you want to clone the repository as part of your setup steps, for example to install dependencies, you'll need the `contents: read` permission. If you don't clone the repository in your setup steps, Copilot will do this for you automatically after the steps complete.
23+
contents: read
24+
25+
# You can define any steps you want, and they will run before the agent starts.
26+
# If you do not check out your code, Copilot will do this for you.
27+
steps:
28+
- name: Checkout code
29+
uses: actions/checkout@v4
30+
31+
- name: Setup necessary dotnet SDKs
32+
uses: actions/setup-dotnet@v4
33+
with:
34+
global-json-file: global.json

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ x86/
2626
[Ww][Ii][Nn]32/
2727
[Aa][Rr][Mm]/
2828
[Aa][Rr][Mm]64/
29-
build/
3029
bld/
3130
[Bb]in/
3231
[Oo]bj/

.vscode/extensions.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"recommendations": [
3+
"ionide.ionide-fsharp",
4+
"ionide.ionide-fake",
5+
"ms-dotnettools.csharp",
6+
"editorConfig.editorConfig"
7+
]
8+
}

.vscode/settings.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"FSharp.fsacRuntime":"netcore",
3+
"FSharp.enableAnalyzers": false,
4+
"FSharp.analyzersPath": [
5+
"./packages/analyzers"
6+
]
7+
}

Directory.Packages.props

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<PropertyGroup>
44
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
55
</PropertyGroup>
6-
<ItemGroup>
6+
<ItemGroup Label="Main">
77
<PackageVersion Include="Argu" Version="6.2.5" />
88
<PackageVersion Include="BenchmarkDotNet" Version="0.15.2" />
99
<PackageVersion Include="BenchmarkDotNet.Diagnostics.Windows" Version="0.15.2" />
@@ -14,16 +14,34 @@
1414
<PackageVersion Include="Ionide.ProjInfo.ProjectSystem" Version="0.70.2" />
1515
<PackageVersion Include="Ionide.ProjInfo.FCS" Version="0.70.2" />
1616
<PackageVersion Include="Ionide.ProjInfo" Version="0.70.2" />
17-
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
1817
<PackageVersion Include="Microsoft.Build" Version="17.14.8" />
1918
<PackageVersion Include="Microsoft.Build.Locator" Version="1.9.1" />
2019
<PackageVersion Include="Microsoft.Build.Framework" Version="17.14.8" />
2120
<PackageVersion Include="Microsoft.Build.Tasks.Core" Version="17.14.8" />
2221
<PackageVersion Include="Microsoft.Build.Utilities.Core" Version="17.14.8" />
22+
<PackageVersion Include="System.Reactive" Version="6.0.1" />
23+
<PackageVersion Include="System.Text.Json" Version="9.0.0" />
24+
</ItemGroup>
25+
<ItemGroup Label="Build and Test">
26+
<PackageVersion Include="altcover" Version="9.0.1" />
27+
<PackageVersion Include="Fake.Api.GitHub" Version="6.1.3" />
28+
<PackageVersion Include="Fake.BuildServer.GitHubActions" Version="6.1.3" />
29+
<PackageVersion Include="Fake.Core.Environment" Version="6.1.3" />
30+
<PackageVersion Include="Fake.Core.Process" Version="6.1.3" />
31+
<PackageVersion Include="Fake.Core.ReleaseNotes" Version="6.1.3" />
32+
<PackageVersion Include="Fake.Core.Target" Version="6.1.3" />
33+
<PackageVersion Include="Fake.DotNet.AssemblyInfoFile" Version="6.1.3" />
34+
<PackageVersion Include="Fake.DotNet.Cli" Version="6.1.3" />
35+
<PackageVersion Include="Fake.DotNet.Paket" Version="6.1.3" />
36+
<PackageVersion Include="Fake.IO.FileSystem" Version="6.1.3" />
37+
<PackageVersion Include="Fake.Tools.Git" Version="6.1.3" />
38+
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
2339
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
40+
<PackageVersion Include="MSBuild.StructuredLogger" Version="2.3.17" />
41+
<PackageVersion Include="NuGet.Common" Version="6.14.0" />
42+
<PackageVersion Include="NuGet.Protocol" Version="6.14.0" />
2443
<PackageVersion Include="NUnit" Version="3.14.0" />
2544
<PackageVersion Include="NUnit3TestAdapter" Version="5.0.0" />
26-
<PackageVersion Include="System.Reactive" Version="6.0.1" />
27-
<PackageVersion Include="System.Text.Json" Version="9.0.0" />
45+
<PackageVersion Include="Unquote" Version="7.0.1" />
2846
</ItemGroup>
2947
</Project>

FSharpLint.slnf

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"solution": {
3+
"path": "FSharpLint.slnx",
4+
"projects": [
5+
"src\\FSharpLint.Console\\FSharpLint.Console.fsproj",
6+
"src\\FSharpLint.Core\\FSharpLint.Core.fsproj",
7+
"tests\\FSharpLint.Benchmarks\\FSharpLint.Benchmarks.fsproj",
8+
"tests\\FSharpLint.Console.Tests\\FSharpLint.Console.Tests.fsproj",
9+
"tests\\FSharpLint.Core.Tests\\FSharpLint.Core.Tests.fsproj",
10+
"tests\\FSharpLint.FunctionalTest\\FSharpLint.FunctionalTest.fsproj"
11+
]
12+
}
13+
}

FSharpLint.slnx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
<Platform Name="x86" />
66
</Configurations>
77
<Folder Name="/Solution Items/">
8-
<File Path="build.fsx" />
98
<File Path="CHANGELOG.md" />
109
<File Path="Directory.Build.props" />
1110
<File Path="Directory.Packages.props" />
@@ -105,4 +104,5 @@
105104
<Project Path="tests/FSharpLint.Core.Tests/FSharpLint.Core.Tests.fsproj" />
106105
<Project Path="tests/FSharpLint.FunctionalTest/FSharpLint.FunctionalTest.fsproj" />
107106
</Folder>
107+
<Project Path="build/build.fsproj" />
108108
</Solution>

0 commit comments

Comments
 (0)