Skip to content

Commit 8e5b6c2

Browse files
committed
Merge branch 'main' of https://github.com/fsprojects/FSharp.Control.TaskSeq into repo-assist/perf-init-remove-lazy-2026-03-2c6e1b4098c5e418
2 parents 54ff867 + b36127a commit 8e5b6c2

File tree

2 files changed

+113
-10
lines changed

2 files changed

+113
-10
lines changed

.github/workflows/publish.yaml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ on:
55
branches:
66
- main
77

8+
permissions:
9+
#contents: write # for peaceiris/actions-gh-pages
10+
id-token: write # for NuGet trusted publishing
11+
812
jobs:
913
publish:
1014
name: Publish nuget (if new version)
@@ -24,13 +28,11 @@ jobs:
2428
# very important, since we use cmd scripts, the default is psh, and a bug prevents errorlevel to bubble
2529
shell: cmd
2630
run: ./build.cmd
27-
- name: Nuget publish
28-
# skip-duplicate ensures that the 409 error received when the package was already published,
29-
# will just issue a warning and won't have the GH action fail.
30-
# NUGET_PUBLISH_TOKEN_TASKSEQ is valid until approx. 11 Dec 2024 and will need to be updated by then:
31-
# - log in to Nuget.org using 'abelbraaksma' admin account and then refresh the token in Nuget
32-
# - copy the token
33-
# - go to https://github.com/fsprojects/FSharp.Control.TaskSeq/settings/secrets/actions
34-
# - select button "Add repository secret" or update the existing one under "Repository secrets"
35-
# - rerun the job
36-
run: dotnet nuget push packages\FSharp.Control.TaskSeq.*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_PUBLISH_TOKEN_TASKSEQ }} --skip-duplicate
31+
- name: Obtain NuGet key
32+
# this hash is v1.1.0
33+
uses: NuGet/login@d22cc5f58ff5b88bf9bd452535b4335137e24544
34+
id: login
35+
with:
36+
user: dsyme
37+
- name: Publish NuGets (if this version not published before)
38+
run: dotnet nuget push packages\FSharp.Control.TaskSeq.*.nupkg -s https://www.nuget.org/api/v2/package -k ${{ steps.login.outputs.NUGET_API_KEY }} --skip-duplicate

AGENTS.md

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
# AGENTS.md — FSharp.Control.TaskSeq
2+
3+
## Project Overview
4+
5+
FSharp.Control.TaskSeq is an F# library providing a `taskSeq` computation expression for `IAsyncEnumerable<'T>`, along with a comprehensive `TaskSeq` module of combinators. It targets `netstandard2.1`.
6+
7+
## Repository Layout
8+
9+
- `src/FSharp.Control.TaskSeq/` — Main library (netstandard2.1)
10+
- `src/FSharp.Control.TaskSeq.Test/` — xUnit test project (net6.0)
11+
- `src/FSharp.Control.TaskSeq.SmokeTests/` — Smoke/integration tests
12+
- `src/FSharp.Control.TaskSeq.sln` — Solution file
13+
- `Version.props` — Single source of truth for the package version
14+
- `build.cmd` — Windows build/test script used by CI
15+
16+
## Build
17+
18+
The solution uses the .NET SDK. Restore tools first, then build:
19+
20+
```bash
21+
dotnet tool restore
22+
dotnet build src/FSharp.Control.TaskSeq.sln -c Release
23+
```
24+
25+
Or use the provided script (Windows):
26+
27+
```cmd
28+
./build.cmd # default: release build
29+
./build.cmd debug # debug build
30+
```
31+
32+
`build.cmd` modes: `build` (default), `test`, `ci`. Configurations: `release` (default), `debug`.
33+
34+
## Test
35+
36+
Tests use **xUnit** with `FsUnit.xUnit` assertions. The test project is at `src/FSharp.Control.TaskSeq.Test/FSharp.Control.TaskSeq.Test.fsproj`.
37+
38+
Run tests locally:
39+
40+
```bash
41+
dotnet test src/FSharp.Control.TaskSeq.Test/FSharp.Control.TaskSeq.Test.fsproj -c Release
42+
```
43+
44+
Or via the build script:
45+
46+
```cmd
47+
./build.cmd test # runs tests without TRX logging
48+
./build.cmd test -debug # debug configuration
49+
./build.cmd ci # CI mode: adds --blame-hang-timeout 60000ms and TRX logging
50+
./build.cmd ci -release # CI mode, release config
51+
./build.cmd ci -debug # CI mode, debug config
52+
```
53+
54+
CI runs both debug and release test configurations on `windows-latest`. Test results are output as TRX files to `src/FSharp.Control.TaskSeq.Test/TestResults/`.
55+
56+
## Code Formatting
57+
58+
Formatting is enforced by **Fantomas** (version 6.3.0-alpha-004, configured as a dotnet local tool).
59+
60+
Check formatting (CI runs this on every PR):
61+
62+
```bash
63+
dotnet tool restore
64+
dotnet fantomas . --check
65+
```
66+
67+
Apply formatting:
68+
69+
```bash
70+
dotnet fantomas .
71+
```
72+
73+
Fantomas settings are in `src/.editorconfig` under the `[*.{fs,fsx}]` section. Key settings:
74+
75+
- `max_line_length = 140`
76+
- `indent_size = 4`
77+
- `fsharp_space_before_parameter = true`
78+
- `fsharp_space_before_lowercase_invocation = true`
79+
- `fsharp_max_if_then_else_short_width = 60`
80+
- `fsharp_max_record_width = 80`
81+
- `fsharp_max_array_or_list_width = 100`
82+
83+
## CI Workflows
84+
85+
All workflows are in `.github/workflows/`:
86+
87+
| Workflow | File | Trigger | Purpose |
88+
|---|---|---|---|
89+
| **ci-build** | `build.yaml` | Pull requests | Verify formatting (`dotnet fantomas . --check`) then build release on Windows |
90+
| **ci-test** | `test.yaml` | Pull requests | Run tests in both debug and release on Windows, upload TRX artifacts |
91+
| **ci-report** | `test-report.yaml` | After `ci-test` completes | Publish test results via `dorny/test-reporter` |
92+
| **Build main** | `main.yaml` | Push to `main` | Build + test release on Windows |
93+
| **Publish** | `publish.yaml` | Push to `main` | Build, then push NuGet package (skip-duplicate) |
94+
95+
## Conventions
96+
97+
- F# source files use `.fs` extension; signature files use `.fsi`.
98+
- `TreatWarningsAsErrors` is enabled for all projects.
99+
- File ordering matters in F# — the `<Compile>` order in `.fsproj` files defines compilation order.
100+
- The library targets `netstandard2.1`; tests target `net6.0` with `FSharp.Core` pinned to `6.0.1`.
101+
- NuGet packages are output to the `packages/` directory.

0 commit comments

Comments
 (0)