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
```yaml title=”.circleci/config.yml” workflows: version: 2 build: jobs:
orbs: crystal: manastech/crystal@1.0 version: 2.1
Yeah! That was simple! With Orbs an abstraction layer is built so that the configuration file is more readable and intuitive.
In case we are wondering what the job [crystal/test](https://circleci.com/orbs/registry/orb/manastech/crystal#jobs-test) does, we always may see the source code.
### Using `nightly`
Using nightly Crystal release is as easy as:
```yaml title=".circleci/config.yml"
workflows:
version: 2
build:
jobs:
name: test-on-nightly
executor:
name: crystal/default
tag: nightly
orbs:
crystal: manastech/crystal@1.0
version: 2.1
Using a specific Crystal release
```yaml title=”.circleci/config.yml” workflows: version: 2 build: jobs:
orbs: crystal: manastech/crystal@1.0 version: 2.1
## Installing shards packages
You need not worry about it since the `crystal/test` 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](https://help.ubuntu.com/lts/serverguide/apt.html) command.
Here is an example installing the `libsqlite3` development package:
```yaml title=".circleci/config.yml"
version: 2
build:
jobs:
- crystal/test:
- run: apt-get update && apt-get install -y libsqlite3-dev
orbs:
crystal: manastech/crystal@1.0
version: 2.1
```yaml title=”.circleci/config.yml” executors: crystal_mysql: docker:
workflows: version: 2 build: jobs:
- crystal/test:
executor: crystal_mysql
pre-steps:
- run:
name: Waiting for service to start (check dockerize)
command: sleep 1m
- checkout
- run:
name: Install MySQL CLI; Import dummy data
command: |
mysql -h 127.0.0.1 -u root --password="" db < test-data/setup.sql
orbs: crystal: manastech/crystal@1.0 version: 2.1 ```
note The explicit
checkout
in thepre-steps
is to have thetest-data/setup.sql
file available.