diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 2b96189..83de497 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -9,7 +9,7 @@ ] }, "fantomas": { - "version": "6.2.3", + "version": "6.3.0-alpha-005", "commands": [ "fantomas" ] diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bb7db90..faee346 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -27,6 +27,5 @@ jobs: - name: Tests run: | - pnpm install - dotnet tool restore - dotnet fable src/Glutinum.Converter --outDir fableBuild --sourceMaps --run vitest run + ./build.sh lint + ./build.sh test diff --git a/src/Glutinum.Build/Main.fs b/src/Glutinum.Build/Main.fs index 1e203c1..bde39e0 100644 --- a/src/Glutinum.Build/Main.fs +++ b/src/Glutinum.Build/Main.fs @@ -15,6 +15,10 @@ Available commands: Options for all except integration and standalone: --watch Watch for changes and re-run the tests + lint Run the linter on the source code + + format Format the source code + publish Publish the different packages to NuGet and NPM based on the CHANGELOG.md files If the last version in the CHANGELOG.md is @@ -33,6 +37,8 @@ let main argv = match argv with | "test" :: args -> Test.Specs.handle args | "publish" :: args -> Publish.handle args + | "lint" :: _ -> Command.Run("dotnet", "fantomas --check src") + | "format" :: _ -> Command.Run("dotnet", "fantomas src") | "help" :: _ | "--help" :: _ | _ -> printHelp () diff --git a/src/Glutinum.Build/Test/Specs.fs b/src/Glutinum.Build/Test/Specs.fs index 3055a16..976da8e 100644 --- a/src/Glutinum.Build/Test/Specs.fs +++ b/src/Glutinum.Build/Test/Specs.fs @@ -2,10 +2,13 @@ module Build.Test.Specs open BlackFox.CommandLine open SimpleExec +open Build.Utils.Pnpm let handle (args: string list) = let isWatch = args |> List.contains "--watch" + Pnpm.install () + let vitestCmd = CmdLine.empty |> CmdLine.appendRaw "npx"