Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CircleCI compatibility #20

Open
per1234 opened this issue Feb 24, 2018 · 0 comments
Open

CircleCI compatibility #20

per1234 opened this issue Feb 24, 2018 · 0 comments

Comments

@per1234
Copy link
Owner

per1234 commented Feb 24, 2018

CircleCI seems to be the primary alternative to Travis CI. It appears their build system is actually much better suited for Arduino projects which require longer build times since the Arduino IDE does not need to be repeatedly downloaded and installed (which represents a significant part of the build duration).

Environment variables

The script has been written to use Travis CI specific environment variables. CircleCI's equivalents (https://circleci.com/docs/1.0/environment-variables/) also need to be supported:

  • Switch according to whether:
  • CIRCLECI is defined as true.
  • TRAVIS is defined as true
  • I should try to set this up in a way that is conducive to use in any build environment (including local use) rather than being locked into a couple specific CI services.
  • TRAVIS_BUILD_NUMBER
    • CIRCLE_BUILD_NUM
  • TRAVIS_JOB_NUMBER
    • CIRCLE_NODE_INDEX
  • TRAVIS_REPO_SLUG
    • Should be able to get this from git?
    • CIRCLE_PROJECT_USERNAME
    • CIRCLE_PROJECT_REPONAME
  • TRAVIS_BUILD_DIR
    • HOME? (this is /home/ubuntu)
    • I should be able to just set this, or maybe $PWD at the start of the build?
  • TRAVIS_JOB_ID (this is used to generate the link to the job log)
    • CIRCLE_BUILD_URL
  • TRAVIS_EVENT_TYPE
    • CIRCLE_PR_NUMBER - can be used to determine if trigger was PR?
    • CIRCLE_TAG - can be used to determien if trigger was tag?
    • Otherwise it was a commit?
  • TRAVIS_ALLOW_FAILURE
    • There is no standard environment variable. I actually don't know if CircleCI has this feature, maybe it's the "experimental" configuration section?
  • TRAVIS_PULL_REQUEST
    • CIRCLE_PR_NUMBER
  • TRAVIS_BRANCH
    • Should be able to get this from git
    • CIRCLE_BRANCH
  • TRAVIS_COMMIT
    • should be able to get this from git
    • CIRCLE_SHA1
  • TRAVIS_COMMIT_RANGE
    • there's no equivalent and I don't think I can determine this.
  • TRAVIS_COMMIT_MESSAGE
    • Should be able to get this from git
  • TRAVIS_TEST_RESULT
    • I could code the script to set this. The only problem is that there might be additional tests in the CI config file that don't use functions of the script
    • Also, CircleCI runs every test in a separate environment so actually I don't think I have any way of sharing data between them
      • Can I store stuff in the artifacts folder (CIRCLE_ARTIFACTS) and then access them from the later builds?

Build system differences

  • Apparently every line of the test is run in a separate environment so I can't share information between them using environment variables.
    • Can I put the information I would usually share by setting global environment variables in the build artifacts folder and then read it back?
      • The build report is already saved as a file.
    • I have a lot of read-only environment variables set at the top of the script
      • I can set global environment variables in one part of the config but I don't think I can download and run the script from there.
      • I could put them in a function and then call that function at the start of every function.

Test script

  • Run a complete CircleCI test of arduino-ci-script
    • Changes required for the arduino-ci-script test build:
      • Create new ci-reports branch for arduino-ci-script CircleCI reports.
      • Create new gist for arduino-ci-script CircleCI reports.
      • I use TRAVIS_REPO_SLUG in .travis.yml.
      • I haven't figured out how to translate the matrix section from my .travis.yml into circle.yml.
        • I don't currently use the matrix for breaking the build into jobs that don't exceed the max duration (though I need to do so).
          • I haven't figured out what the time limit is, if any.
        • CircleCI has some parallelism thing but I haven't figured out how I could use that.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant