Test changes to CircleCI config locally

Rather than pushing the code to a remote branch and then testing via Circle CI servers, it is best to run the tests locally first and make them work. Here’s how you can do that.

  1. Install circleci CLI (On Mac, that would be brew install circleci)
  2. Write/modify the config in .circleci/config.yml
  3. Validate config with circleci config validate
  4. Test the job by running circleci local execute to execute all jobs or circleci local execute --job <job-name> to run a specific job. And once that passes, push the code.
  5. Now enable Circle CI on the repo.
  6. Add Circle CI Status badge to your repository.

Leave a Reply

Your email address will not be published. Required fields are marked *