Skip to main content

Integrating in CI

Travis CI#

  • Add to your Travis settings a secret named GREENFRAME_SECRET_TOKEN with your API token.

  • Add a .travis.yml containing:

git:
depth: false # Fetch all the git history
before_install:
- sudo apt-get update
- curl https://assets.greenframe.io/install.sh | bash
script:
# Start your application here
- greenframe analyze

If you want to activate the automatic comparison with your base branch, GreenFrame CLI needs to be able to get the commit ID ancestor. Travis disables the git history by default in order to speed up your build time. You have to overwrite the git clone depth:

git:
depth: false # Fetch all the git history

Github Actions#

  • Add to your repo settings a secret named GREENFRAME_SECRET_TOKEN with your API token.

  • Add a .github/workflows/greenframe.yml containing:

name: Greenframe Analysis
on: [push]
jobs:
greenframeci:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
with:
fetch-depth: 0 # Fetch all the git history
- run: curl https://assets.greenframe.io/install.sh | bash
# Start your application here
- run: greenframe analyze
env:
GREENFRAME_SECRET_TOKEN: ${{secrets.GREENFRAME_SECRET_TOKEN}}

If you want to activate the automatic comparison with your base branch, GreenFrame CLI needs to be able to get the commit ID ancestor. Gthub actions disables the git history by default in order to speed up your build time. You have to overwrite the fetch-depth parameter inside the checkout github actions:

- uses: actions/[email protected]
with:
fetch-depth: 0 # Fetch all the git history