Continuous Integration with Circle-CI

I’ve seen there is a .circleci/config.yml for Julia itself, but is there any support yet for using circle-ci instead of or in addition to Travis for testing Julia packages?
(esp. with scripts to get coverage data pushed to CodeCov, which the default .travis.yml scripts do).

1 Like

I have not tried this, but you could do a github search and see if you find something matching. Or go over the circle CI https://circleci.com/docs/2.0/examples/#open-source-projects-by-language.

My guess would be, as Circle CI is more on the commercial side (“The First Container Is Free + Each Additional Container Is $50/month”) that only open source with some financial backing is there.

But you can start reading the julia config and see what you can reuse.

This will not help you if you want CircleCI specifically, but if you just want an alternative to Travis, I have an example setup on Gitlab:

The main advantage is that you can also do CI for private repos.

5 Likes

All I was looking for (today) was a way of doing CI and CodeCov on a private Julia repo (for work)

As long as I can do a single private repo for free, I’m golden.

Thanks!

1 Like

I thought Travis has published a second new website where you can also have private repos

https://docs.travis-ci.com/user/travis-ci-for-private/

I may be missing something, but that looks like a trial (100 free builds).

I think there are some CI services that give some number of free builds per month, is that a single use of 100 builds, or is it per month?

Also, fwiw, this actually seemed to work just fine for me!:

# .circleci/config.yml
version: 2
jobs:
  build:
    working_directory: /root/project/Example   # Clone into a directory whose name matches your Package.
    docker:
      - image: julia:0.7                # image comes from Docker hub
    steps:
      - checkout
      - run:
          name: Install and Test this package
          command: julia -e 'using Pkg; Pkg.update(); Pkg.clone(pwd()); Pkg.build("Example"); Pkg.test("Example");'
2 Likes

I put this together to work with codecov.io for a private github repo:

# .circleci/config.yml
version: 2.1
orbs:
  codecov: codecov/codecov@1.0.2 # need to allow 3rd party orbs in project settings on circleci
jobs:
  build:
    working_directory: /root/project/RoecketScience   # Clone into a directory whose name matches your Package.
    docker:
      - image: julia:1.1                # image comes from Docker hub
    steps:
      - checkout
      - run:
          name: Install and Test this package
          command: julia -e  'using Pkg; Pkg.update(); Pkg.clone(pwd()); Pkg.build("MyPkg"); Pkg.test("MyPkg", coverage=true);'
      - run:
          name: Process code-coverage
          command: julia -e 'using Pkg; cd(Pkg.dir("MyPkg")); Pkg.add("Coverage"); using Coverage; coverage = process_folder(); LCOV.writefile("coverage-lcov.info", coverage)'
      - codecov/upload:
          file: "coverage-lcov.info"
          token: "..." # get from https://codecov.io/gh/github-name/MyPkg.jl/settings

Maybe also needed is a .codecov.yml with one line comment: false.

2 Likes