diff --git a/src/detect.ts b/src/detect.ts index 9298ea0..85c1656 100644 --- a/src/detect.ts +++ b/src/detect.ts @@ -78,6 +78,35 @@ export default async function detect(src: string): Promise { return; } + if ( + (await fileExists(`${src}/spago.yaml`)) || + (await fileExists(`${src}/spago.dhall`)) + ) { + await actions.save(project.id, [ + { + id: createId(), + name: "tests", + commands: "test", + enabled: true, + plugin: "purescript", + useWasm: true, + logo: "https://upload.wikimedia.org/wikipedia/commons/6/64/PureScript_Logo.png", + githubUrl: "https://github.com/fluentci-io/purescipt-plugin", + }, + { + id: createId(), + name: "build", + commands: "build", + enabled: true, + plugin: "purescript", + useWasm: true, + logo: "https://upload.wikimedia.org/wikipedia/commons/6/64/PureScript_Logo.png", + githubUrl: "https://github.com/fluentci-io/purescript-plugin", + }, + ]); + return; + } + if ( (await fileExists(`${src}/package.json`)) && (await fileExists(`${src}/bun.lockb`)) @@ -409,7 +438,32 @@ export default async function detect(src: string): Promise { githubUrl: "https://github.com/fluent-ci-templates/swift-pipeline", }, ]); + return; + } + if (await fileExists(`${src}/cabal.project`)) { + await actions.save(project.id, [ + { + id: createId(), + name: "tests", + commands: "test", + enabled: true, + plugin: "haskell", + useWasm: true, + logo: "https://upload.wikimedia.org/wikipedia/commons/1/1c/Haskell-Logo.svg", + githubUrl: "https://github.com/fluentci-io/haskell-plugin", + }, + { + id: createId(), + name: "build", + commands: "build", + enabled: true, + plugin: "haskell", + useWasm: true, + logo: "https://upload.wikimedia.org/wikipedia/commons/1/1c/Haskell-Logo.svg", + githubUrl: "https://github.com/fluentci-io/haskell-plugin", + }, + ]); return; } @@ -435,6 +489,13 @@ export async function detectProjectType(src: string): Promise { return "go"; } + if ( + (await fileExists(`${src}/spago.yaml`)) || + (await fileExists(`${src}/spago.dhall`)) + ) { + return "purescript"; + } + if ( (await fileExists(`${src}/package.json`)) && (await fileExists(`${src}/bun.lockb`)) @@ -496,5 +557,9 @@ export async function detectProjectType(src: string): Promise { return "swift"; } + if (await fileExists(`${src}/cabal.project`)) { + return "haskell"; + } + return "base"; }