You can use this config in any of your projects.
So you don't have to copy-paste .yml
in your CircleCI® configs.
Feel free to fork this into your own Create Config repo.
You might want different settings, like different image sizes.
Or maybe you use different languages.
This has JavaScript and PHP.
import { createConfig, JobNames } from "@getlocalci/create-config";
createConfig(JobNames.PhpLint, JobNames.PhpTest, JobNames.Zip);
import CircleCI from "@circleci/circleci-config-sdk";
import { createConfig, JobNames } from "@getlocalci/create-config";
createConfig(
JobNames.JsLint,
JobNames.JsTest,
new CircleCI.Job(
"python-test",
new CircleCI.executors.DockerExecutor("cimg/python:3.10.7", "large"),
[
new CircleCI.commands.Checkout(),
new CircleCI.commands.Run({ command: "pip install && python -m pytest" }),
]
)
);
Here, you can add a CircleCI.Job
with your own values.
For example, maybe you have a typical config you use for most of your repos.
But maybe a repo needs a job that no other repos need.
You can pass that CircleCI.Job
as an argument to createConfig()
.
Thank you, Kyle Tryon and Jaryt Bustard, for creating the CircleCI Config SDK.
This repo uses Kyle's idea of a common function in different repos.
See this in action at .circleci/dynamic/.
This repo uses its own createConfig()
to test itself 🤣