Travis CI is one of the most popular CI servers for open source software. At Ortus Solutions, we use it for all of our open source software due to its strength of pull request runners and multi-matrix runners. They have both free and commercial versions, so you can leverage it for private projects as well.
FREE for Open Source Projects
Runs distributed VM’s and Container Support
Triggers Build Script via git repository commits (.travis.yml
)
Multiple language support
Many integrations and extensions
Many notification types
No ability to schedule/manual builds
Great for open source projects!
In order to work with Travis you must create a .travis.yml
file in the root of your project. Once there are commits in your repository, Travis will process this file as your build file. Please refer to the Travis Documentation for further study.
This build file is based on the java
language and an Ubuntu Trusty image. We start off by executing the before_install
step which installs all the OS dependencies we might need. In our case we add the CommandBox repository server keys and install CommandBox as our dependency. We then move to our install
step which makes sure we have all the required software dependencies to execute our tests, again this looks at our box.json
for TestBox and required project dependencies. After issuing the box install
we move to starting up the CFML engine using box server start
and we are ready to test.
The testing occurs in the script
block:
In our script we basically install our dependencies for our project using CommandBox and startup a CFML server. We then go ahead and execute our tests via box testbox run
.
In order for the box testbox run
to execute correctly, our box.json
in our project must be able to connect to our server and know which tests to execute. Below are all the possiblities for the testbox
integration object in CommandBox's box.json
. (See the CommandBox docs for box.json for more details.)
You can look at our cbVue
sample application online: https://travis-ci.org/coldbox-samples/cbvue which contains all CI server integrations.
GitHub Actions is an automation platform built in to GitHub.com that makes it easy to automate code quality on your github repos. There are a number of integrations that make using TestBox inside GitHub Actions simple, speedy and powerful so you can get back to writing code.
FREE for public repositories
2,000 minutes for private repos
Can reuse workflows, i.e. for a standard test.yml
workflow in both builds and PR testing
Can schedule workflow runs
[Can configure a build "matrix"], i.e. for testing against all recent CFML engines
Testing your application with TestBox in GitHub Actions (GHA) begins a workflow.yml
file at the root of a .github/workflows/
directory. You can name this file anything you like - I'd suggest build.yml
or test.yml
- but if it is not a valid Yaml file the GHA workflow will fail.
This file should start with some GHA metadata to dictate when and how the workflow should run:
This will run the workflow on each commit to the master
or main
branch. Next, specify a workflow job to execute:
Under the jobs.tests.steps
is where we will place each sequential testing step. First, we need to check out the repository code and install Java and CommandBox:
If we need to install dependencies, we would do that now:
And finally, we can start a CFML server of our choice using CommandBox, before using the testbox run
command to run our test suite:
If you are using a testing matrix to test against multiple CFML engines, replace
lucee@5.3
with${{ matrix.cfengine }}
. See an example here
The full example would look something like this:
In order for the box testbox run
to execute correctly, our box.json
in our project must be able to connect to our server and know which tests to execute. Here's a basic example showing the most important testbox property: the testbox.runner
property:
We can also skip setting the testbox.runner
property and use the box testbox run "http://localhost:8080/tests/runner.cfm"
command format instead. Just be aware that the TestBox integration offers a ton of configuration in case you need to skip certain tests, etc. from your GitHub Actions test run.
See the CommandBox docs for box.json for more details.
CBORM is an ORM utility wrapper for ColdBox that takes the pain out of using ORM in CFML. CBORM uses GitHub Actions to test all new commits, to package up new module versions, and even to format all CFML code for every new PR.
See All CBORM Workflows, or see recent GitHub Actions workflow runs here.
is one of the most popular collaboration software suites around. It is not only a CI server, but a source code server, docker registry, issue manager, and much much more. They are our personal favorite for private projects due to their power and flexibility.
All in one tool: CI, repository, docker registry, issues/milestones, etc.
Same as Travis in concept - CI Runner
Docker based
CI Runners can be decoupled to a docker swarm
Idea of CI pipelines
Pipelines composed of jobs executed in stages
Jobs can have dependencies, artifacts, services, etc
Schedule Pipelines (Cron)
Jobs can track environments
Great stats + charting
The build file above leverages the ortussolutions/commandbox:alpine
image, which is a compact and secure image for CommandBox. We then have a few stages (build,test,deploy), but let's focus on the run_tests
job.
We define which branches it should listen to: development
, and then we have a script
block that defines what to do for this job. Please note that the when
action is commented, because we want to execute this job every time there is a commit. In Gitlab we can determine if a job is manual, scheduled, automatic or dependent on other jobs, which is one of the most flexible execution runners around.
In our script we basically install our dependencies for our project using CommandBox and startup a CFML server. We then go ahead and execute our tests via box testbox run
.
(CI) is a development process that requires developers to integrate their code into a shared source code repository (git,svn,mercurial,etc) several times a day, while a monitoring process detects code commits and acts upon those commits. Those actions can be the actual checkout of branches, execution of build processes, quality control, and of course our favorite; automated testing.
TestBox can integrate with all major CI servers as all you need to do is be able to execute your test suites and produce reports. You can see that in our section and .
Decrease the feedback loop
Discover defects faster before production releases
Developer Accountability
Increase code visibility and promote communication
Increase quality control
Reduce integration issues with other features
Develop in an Agile/Scrum fashion with continuous improvement
Much More...
Here is a listing of some of the major CI servers:
In order to work with Gitlab you must create a .gitlab-ci.yml
file in the root of your project. Once there are commits in your repository, Gitlab will process this file as your build file. Please refer to the Gitlab Pipelines for further study.
We will leverage the image in order to provide us with the capability to run any CFML engine and to execute tests. Please note that Gitlab runs in a docker environment.
In order for the box testbox run
to execute correctly, our box.json
in our project must be able to connect to our server and know which tests to execute. Below are all the possiblities for the testbox
integration object in CommandBox's box.json
. (See for more details.)
You can look at our cbVue
sample application online: which contains all CI server integrations.
Jenkins -
Gitlab -
Travis -
Bamboo -
TeamCity -