From 3598af1b07109fd78bb944dbd6a7185b24e7548c Mon Sep 17 00:00:00 2001 From: Venu Vardhan Reddy Tekula Date: Thu, 14 Jan 2021 18:19:14 +0530 Subject: [PATCH] [CI] Migrate from Travis CI to GitHub Actions Travis CI has brought a few changes in its plans which is causing friction to the current workflow. This commit removes the support of Travis CI and adds the support of GitHub Actions as the new CI service. Signed-off-by: Venu Vardhan Reddy Tekula --- .github/workflows/ci.yml | 76 ++++++++++++++++++++++++++++++++++++++++ .travis.yml | 51 --------------------------- README.md | 2 +- tests/utils.py | 6 ++-- 4 files changed, 80 insertions(+), 55 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..609d90c --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,76 @@ +name: build + +on: [push, pull_request] + +jobs: + tests: + + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [3.6, 3.7, 3.8] + + name: Python ${{ matrix.python-version }} + steps: + - uses: actions/checkout@v2 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + + - name: Set up Ruby + uses: actions/setup-ruby@v1 + with: + ruby-version: 2.6 + + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.15 + + - name: Install dependencies + run: | + pip install --upgrade setuptools==49.6.0 + pip install --upgrade pip==18.1 + pip install --upgrade wheel + pip install -r "requirements.txt" + pip install flake8 coveralls + gem install github-linguist + pip install bandit pylint execnet + wget https://github.com/fossology/fossology/releases/download/3.8.1/FOSSology-3.8.0-debian9stretch.tar.gz + tar -xzf FOSSology-3.8.0-debian9stretch.tar.gz + sudo apt-get update -y + sudo apt-get -y install ./packages/fossology-common_3.8.1-1_amd64.deb ./packages/fossology-nomos_3.8.1-1_amd64.deb + sudo apt-get install cloc + eval "$(gimme stable)" + + - name: Install Graal + run: ./setup.py install + + - name: Install requirements + run: | + mkdir exec + cd exec + go get -u github.com/boyter/scc/ + cd $GITHUB_WORKSPACE/exec/ + git clone https://github.com/nexB/scancode-toolkit.git + cd scancode-toolkit + git checkout -b test_scancli 96069fd84066c97549d54f66bd2fe8c7813c6b52 + ./scancode --help + cd $GITHUB_WORKSPACE/exec/ + wget https://github.com/crossminer/crossJadolint/releases/download/Pre-releasev2/jadolint.jar + cd $GITHUB_WORKSPACE/ + + - name: Lint with flake8 + run: flake8 . --exclude=exec,src + + - name: Tests and Coverage + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + cd tests + coverage run --source=graal run_tests.py + # --service=github is a workaround for bug + # https://github.com/coveralls-clients/coveralls-python/issues/251 + coveralls --service=github diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 9437fca..0000000 --- a/.travis.yml +++ /dev/null @@ -1,51 +0,0 @@ -language: python -dist: bionic -os: linux - -python: - - "3.6" - - "3.7" - - "3.8" - -sudo: false - -before_install: - - pip install --upgrade setuptools==49.6.0 - - pip install --upgrade pip==18.1 - - pip install -r "requirements.txt" - - pip install flake8 - - pip install coveralls - - gem install github-linguist - - pip install bandit - - pip install pylint - - pip install execnet - - wget https://github.com/fossology/fossology/releases/download/3.8.1/FOSSology-3.8.0-debian9stretch.tar.gz - - tar -xzf FOSSology-3.8.0-debian9stretch.tar.gz - - sudo apt-get update -y - - sudo apt-get -y install ./packages/fossology-common_3.8.1-1_amd64.deb ./packages/fossology-nomos_3.8.1-1_amd64.deb - - sudo apt-get install cloc - - eval "$(gimme stable)" - -install: - - ./setup.py install - -before_script: - - mkdir exec - - cd exec - - go get -u github.com/boyter/scc/ - - cd /home/travis/build/chaoss/grimoirelab-graal/exec - - git clone https://github.com/nexB/scancode-toolkit.git - - cd scancode-toolkit - - git checkout -b test_scancli 96069fd84066c97549d54f66bd2fe8c7813c6b52 - - ./scancode --help - - cd /home/travis/build/chaoss/grimoirelab-graal/exec - - wget https://github.com/crossminer/crossJadolint/releases/download/Pre-releasev2/jadolint.jar - - cd /home/travis/build/chaoss/grimoirelab-graal - -script: - - flake8 . --exclude=exec - - cd tests - - coverage run --source=graal run_tests.py - -after_success: - - coveralls diff --git a/README.md b/README.md index 72a7ee6..ece50f3 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Graal: a Generic Repository AnALyzer [![Build Status](https://travis-ci.org/chaoss/grimoirelab-graal.svg?branch=master)](https://travis-ci.org/chaoss/grimoirelab-graal) [![Coverage Status](https://coveralls.io/repos/github/chaoss/grimoirelab-graal/badge.svg?branch=master)](https://coveralls.io/github/chaoss/grimoirelab-graal?branch=master) +# Graal: a Generic Repository AnALyzer [![Build Status](https://github.com/chaoss/grimoirelab-graal/workflows/build/badge.svg)](https://github.com/chaoss/grimoirelab-graal/actions?query=workflow:build+branch:master+event:push) [![Coverage Status](https://coveralls.io/repos/github/chaoss/grimoirelab-graal/badge.svg?branch=master)](https://coveralls.io/github/chaoss/grimoirelab-graal?branch=master) Graal leverages on the Git backend of [Perceval](https://github.com/chaoss/grimoirelab-perceval) and enhances it to set up ad-hoc source code analysis. Thus, it fetches the commits from a Git repository and provides a mechanism to plug third party tools/libraries focused on source code analysis. diff --git a/tests/utils.py b/tests/utils.py index e0380a5..702f336 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -22,6 +22,6 @@ # NOMOS_PATH = "/usr/share/fossology/nomos/agent/nomossa" -SCANCODE_PATH = "/home/travis/build/chaoss/grimoirelab-graal/exec/scancode-toolkit/scancode" -SCANCODE_CLI_PATH = "/home/travis/build/chaoss/grimoirelab-graal/exec/scancode-toolkit/etc/scripts/scancli.py" -JADOLINT_PATH = "/home/travis/build/chaoss/grimoirelab-graal/exec/jadolint.jar" +SCANCODE_PATH = "/home/runner/work/grimoirelab-graal/grimoirelab-graal/exec/scancode-toolkit/scancode" +SCANCODE_CLI_PATH = "/home/runner/work/grimoirelab-graal/grimoirelab-graal/exec/scancode-toolkit/etc/scripts/scancli.py" +JADOLINT_PATH = "//home/runner/work/grimoirelab-graal/grimoirelab-graal/exec/jadolint.jar"