CircleCI

    In this section we are going to present some configuration examples to see how CircleCI implements some continuous integration concepts.

    Before showing some examples, it’s worth mentioning . As defined in the official docs:

    In our case, we are going to use Crystal’s Orb

    Build and run specs

    Let’s start with a simple example. We are going to run the tests using latest Crystal release:

    .circleci/config.yml

    In case we are wondering what the job crystal/test does, we always may see the source code.

    Using nightly Crystal release is as easy as:

    .circleci/config.yml

    .circleci/config.yml

    You need not worry about it since the job runs the crystal/shard-install orb command.

    Installing binary dependencies

    Our application or maybe some shards may require libraries and packages. This binary dependencies may be installed using the Apt command.

    .circleci/config.yml

    Now, let’s run specs using an external service (for example MySQL):

    .circleci/config.yml

    Note

    The explicit checkout in the is to have the test-data/setup.sql file available.

    Caching

    Caching is enabled by default when using the job crystal/test, because internally it uses the command with-shards-cache