Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
58c72ef
refactor(docs): migrate `Fornax` to `0.15.1`
xperiandri Jul 7, 2025
5e5b4d0
fix(docs): reference resolution and missing site info
xperiandri Jul 7, 2025
2d6a6ec
feat(ci): signal the pipeline that docs generation failed
xperiandri Jul 8, 2025
5ff152c
refactor(docs): simplify `generateNamespace` funtions usage
xperiandri Jul 8, 2025
1d3b137
refactor(docs): use variable for the common string constants in `apir…
xperiandri Jul 8, 2025
610075f
fixup! feat(ci): signal the pipeline that docs generation failed
xperiandri Jul 8, 2025
0c501ed
fixup! refactor(docs): use variable for the common string constants i…
xperiandri Jul 9, 2025
9d6fed7
Fornax 0.16.0 and FSharp.Formatting 20.0.1
Numpsy Jul 9, 2025
7f487c2
fixup! fix(docs): reference resolution and missing site info
xperiandri Jul 9, 2025
bf95a0b
fixup! Fornax 0.16.0 and FSharp.Formatting 20.0.1
xperiandri Jul 9, 2025
53634ab
fixup! Fornax 0.16.0 and FSharp.Formatting 20.0.1
xperiandri Jul 9, 2025
96cee24
feat(ci): Fake build project
xperiandri Jul 7, 2025
1273264
feat(ci): run all tests on new CI
xperiandri Jul 7, 2025
2d0b69d
feat(ci): run `Fornax` to build docs
xperiandri Jul 7, 2025
3e086ee
feat(ci): build only `FSharpLint.Core` for docs
xperiandri Jul 7, 2025
6ed6390
feat(ci): self check the solution
xperiandri Jul 7, 2025
bb29921
feat(ci): use `v*` version tag instead of `releases/*`
xperiandri Jul 7, 2025
f03ba05
fixup! feat(ci): Fake build project
xperiandri Jul 8, 2025
a66df45
fixup! feat(ci): Fake build project
xperiandri Jul 8, 2025
f51c133
squash! feat(ci): Fake build project
xperiandri Jul 8, 2025
351d768
chore(ci): remove `Octokit` package version update
xperiandri Jul 8, 2025
79fac28
fixup! feat(ci): Fake build project
xperiandri Jul 9, 2025
16ef629
fixup! feat(ci): self check the solution
xperiandri Jul 9, 2025
450c033
fixup! feat(ci): Fake build project
xperiandri Jul 9, 2025
7778841
refactor(ci): move `NuGet.config` package source mapping creation fro…
xperiandri Jul 9, 2025
15505f9
refactor(ci): parse `NuGet.config` with `System.Xml.Linq`
xperiandri Jul 9, 2025
5e2c1a3
fixup! feat(ci): Fake build project
xperiandri Jul 9, 2025
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
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"rollForward": false
},
"fornax": {
"version": "0.13.1",
"version": "0.16.0-beta002",
"commands": [
"fornax"
],
Expand Down
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"
}
131 changes: 35 additions & 96 deletions .github/workflows/build+test+deploy.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,18 @@
name: CI
name: Build, Test and SelfCheck

on:
pull_request:
workflow_dispatch:

# to execute once a day (more info see https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule )
schedule:
- cron: '0 0 * * *'
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@xperiandri why remove the schedule? this way we make sure that CI is still working, and when it breaks for reasons unrelated to FSharpLint commits we notice right away. Before I added this schedule job it used to happen that suddenly some new commit landed in master and broke CI and we were scratching our heads for days wondering how that commit could break the build, until we realised the CI broke by itself, unrelated to the commit.


push:
tags:
- 'v*'
branches:
- master
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@xperiandri I know that you have put '**' for pull_request, but still putting this filter here will mean that a contributor that is about to post a PR won't get CI feedback until she proposes the PR, which is unnecessary. Contributors should be able to see the CI statuses before creating PRs.

pull_request:
branches:
- '**'

env:
DOTNET_VERSION: 9.0.201

jobs:
buildAndTest:

build:
strategy:
matrix:
configuration: [Debug, Release]
os:
- ubuntu-latest
- windows-latest
Expand All @@ -30,100 +21,48 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Setup .NET
- name: Setup necessary dotnet SDKs
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Restore tools
run: dotnet tool restore
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet fsi build.fsx -t Build
- name: Run tests
run: dotnet fsi build.fsx -t Test
- name: Run FSharpLint on itself
run: dotnet fsi build.fsx -t SelfCheck
global-json-file: global.json

- name: Build via Bash
if: runner.os != 'Windows'
run: ./build.sh
env:
CI: true
CONFIGURATION: ${{ matrix.configuration }}
- name: Build via Windows
if: runner.os == 'Windows'
run: ./build.cmd
env:
CI: true
CONFIGURATION: ${{ matrix.configuration }}

deployReleaseBinaries:
needs: buildAndTest
# Run SelfCheck once on Linux to check for lint warnings
selfcheck:
runs-on: ubuntu-latest

needs: build
steps:
- uses: actions/checkout@v4
- name: Setup .NET
- name: Setup necessary dotnet SDKs
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Restore tools
run: dotnet tool restore
- name: Build
run: dotnet fsi build.fsx
- name: Pack
run: dotnet fsi build.fsx -t Pack
- 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)
env:
nuget-key: ${{ secrets.NUGET_KEY }}
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
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
global-json-file: global.json

- name: Run SelfCheck
run: ./build.sh SelfCheck
env:
CI: true

deployReleaseDocs:
needs: deployReleaseBinaries
# Builds the project in a dev container
build-devcontainer:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

# old .NET required by old fornax version
- name: Setup old .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 3.1.x
- uses: actions/checkout@v4

- name: Restore tools
run: dotnet tool restore
- name: Restore dependencies
run: dotnet restore
- name: Run Fornax
run: dotnet fsi build.fsx -t Docs
- name: Deploy (if tag)
if: startsWith(github.ref, 'refs/tags/')
uses: peaceiris/actions-gh-pages@v3
- name: Build and run dev container task
uses: devcontainers/ci@v0.3
with:
personal_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/_public
publish_branch: gh-pages
force_orphan: true
runCmd: ./build.sh
34 changes: 34 additions & 0 deletions .github/workflows/copilot-setup-steps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: "Copilot Setup Steps"

# Automatically run the setup steps when they are changed to allow for easy validation, and
# allow manual testing through the repository's "Actions" tab
on:
workflow_dispatch:
push:
paths:
- .github/workflows/copilot-setup-steps.yml
pull_request:
paths:
- .github/workflows/copilot-setup-steps.yml

jobs:
# The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot.
copilot-setup-steps:
runs-on: windows-2025

# Set the permissions to the lowest permissions possible needed for your steps.
# Copilot will be given its own token for its operations.
permissions:
# 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.
contents: read

# You can define any steps you want, and they will run before the agent starts.
# If you do not check out your code, Copilot will do this for you.
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup necessary dotnet SDKs
uses: actions/setup-dotnet@v4
with:
global-json-file: global.json
57 changes: 57 additions & 0 deletions .github/workflows/fornax-gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Deploy Docs

on:
# Runs on pushes targeting the default branch
push:
branches: ["master"]
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@xperiandri we want PRs to the docs to also be tested before being merged, so please stop using the branches attribute, it is a bad practice


# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Pages
uses: actions/configure-pages@v5

- name: Setup necessary dotnet SDKs
uses: actions/setup-dotnet@v4
with:
global-json-file: global.json

- name: Build Docs
run: ./build.sh builddocs

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs/_public

# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
33 changes: 33 additions & 0 deletions .github/workflows/publish_ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Publish to GitHub

on:
push:
branches:
- master
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@xperiandri even if we only want to publish for master branch, the way to filter it is to prevent the last step from happening (the nuget push) if branch is not master. This way the job is still being tested everytime, even for PRs.


env:
CONFIGURATION: Release

jobs:
build:
# Sets permissions of the GITHUB_TOKEN to allow release creating
permissions:
packages: write
environment:
name: nuget
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup necessary dotnet SDKs
uses: actions/setup-dotnet@v4
with:
global-json-file: global.json

- name: Publish to GitHub
env:
NUGET_TOKEN: ${{ secrets.NUGET_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
FAKE_DETAILED_ERRORS: true
run: ./build.sh "PublishToGitHub"
Loading
Loading