Skip to content

Commit

Permalink
Merge pull request #49 from fluentci-io/feat/detect-swift-projects
Browse files Browse the repository at this point in the history
feat: detect swift projects
  • Loading branch information
tsirysndr authored Jun 21, 2024
2 parents 4354520 + 3fcabe1 commit e62f083
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions src/detect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,33 @@ export default async function detect(src: string): Promise<void> {
return;
}

if (await fileExists(`${src}/Package.swift`)) {
await actions.save(project.id, [
{
id: createId(),
name: "tests",
commands: "test",
enabled: true,
plugin: "swift",
useWasm: true,
logo: "https://cdn.jsdelivr.net/gh/fluent-ci-templates/.github/assets/swift.svg",
githubUrl: "https://github.com/fluent-ci-templates/swift-pipeline",
},
{
id: createId(),
name: "build",
commands: "build",
enabled: true,
plugin: "swift",
useWasm: true,
logo: "https://cdn.jsdelivr.net/gh/fluent-ci-templates/.github/assets/swift.svg",
githubUrl: "https://github.com/fluent-ci-templates/swift-pipeline",
},
]);

return;
}

await actions.save(project.id, [
{
id: createId(),
Expand Down Expand Up @@ -465,5 +492,9 @@ export async function detectProjectType(src: string): Promise<string> {
return "sbt";
}

if (await fileExists(`${src}/Package.swift`)) {
return "swift";
}

return "base";
}

0 comments on commit e62f083

Please sign in to comment.