diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml new file mode 100644 index 00000000..883b157b --- /dev/null +++ b/.github/workflows/testing.yml @@ -0,0 +1,57 @@ +name: Unit and Funtional Testing + +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: ๐Ÿ - Set up Python 3.6 + uses: actions/setup-python@v2 + with: + python-version: '3.6' + - name: โš™๏ธ - Configure sysctl limits + run: | + sudo swapoff -a + sudo sysctl -w vm.swappiness=1 + sudo sysctl -w fs.file-max=262144 + sudo sysctl -w vm.max_map_count=262144 + - name: ๐Ÿ”Ž - Runs Elasticsearch + uses: elastic/elastic-github-actions/elasticsearch@master + with: + stack-version: 7.3.0 + - name: โš™๏ธ๐Ÿ”Ž - Setup elastic search + run: | + curl 'localhost:9200' + curl -XPUT 'localhost:9200/test?pretty' -H 'Content-Type: application/json' -d @config/elastic_mapping.json + curl -XPUT 'localhost:9200/ida?pretty' -H 'Content-Type: application/json' -d @config/elastic_ida_mapping.json + - name: ๐Ÿ”ง - Install Dependencies + run: | + pip install -r requirements.txt + pip install -r dev_requirements.txt + pip install tblib + pip freeze + - name: ๐Ÿงช - Testing + run: | + export BROWSER_TEST=chrome + coverage run --source='.' manage.py test + - name: ๐Ÿงฅโ€ - Coveralls + continue-on-error: true + run: | + export COVERALLS_REPO_TOKEN=0NCZQkRT7k27xoKabeCH3UzAEUIDk5BAw + coveralls + - name: ๐Ÿ“ฎ - Slack Notification + uses: rtCamp/action-slack-notify@v2 + continue-on-error: true + if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev' + env: + SLACK_COLOR: "${{ job.status == 'success' && 'good' || 'danger' }}" + SLACK_USERNAME: "Github Actions API" + SLACK_ICON_EMOJI: ":octocat:" + SLACK_TITLE: "CI API results in GitHub Actions" + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} + SLACK_CHANNEL: "#interpro7" + MSG_MINIMAL: Actions URL diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index a8561806..00000000 --- a/.travis.yml +++ /dev/null @@ -1,42 +0,0 @@ -sudo: required -dist: xenial -services: - - xvfb -language: python -python: - - "3.6" -addons: - chrome: stable -before_install: - - "export BROWSER_TEST=chrome" - - wget http://chromedriver.storage.googleapis.com/85.0.4183.83/chromedriver_linux64.zip - - unzip chromedriver_linux64.zip - - sudo cp chromedriver /usr/local/bin/. && sudo chmod 755 /usr/local/bin/chromedriver - - sleep 3 - - curl -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.3.0-amd64.deb && sudo dpkg -i --force-confnew elasticsearch-7.3.0-amd64.deb - - sudo chown -R elasticsearch:elasticsearch /etc/default/elasticsearch - - sudo service elasticsearch restart -install: - - pip install -r requirements.txt - - pip install -r dev_requirements.txt - - pip install tblib - - pip freeze -before_script: - - sleep 10 - - "curl 'localhost:9200'" - - "curl -XPUT 'localhost:9200/test?pretty' -H 'Content-Type: application/json' -d @config/elastic_mapping.json" - - "curl -XPUT 'localhost:9200/ida?pretty' -H 'Content-Type: application/json' -d @config/elastic_ida_mapping.json" -script: - - coverage run --source='.' manage.py test -after_success: - coveralls -notifications: - slack: - on_success: change - on_failure: always - secure: VK+fSEw/3kwgxXiBLnuKdLb7pHl5oB5PqvZYZATW5uCHOuBr6z++10wVatuK0LYMRT3582v+0PJ+Vu59Wgj/iYn+l8VR24QzyKQsHfHBrt+gWlOWHhKkVlfBwKnoPaLGyw90epWRYRWKRkBJFbMROWcWxxxk5KeflPgc1gT5Qd69BiZWgrffAKfNHRr7aqA52B0lrg2H8hRY1fUrUfWh3Ns3PePrFTLxim4efB84ITuXpEn+H8M+J6EHk+NBRanPuNa0fln49PHJMsTxwkIOEZXGkha/PpKOVxnifvq05Qyb17+x54PuoLktqkok392PG9+O1nW9E4tcWQVtYKtkr29NR2K+dHZX3rZoS21GuMqxl8ZuP2wwaJqP48zu2QGCFk03LjWg/NgdBV+TBUG43imdKS8cvVPWSRh6IRFPbDwCGcUVMe0qwo+nYaGkj9BL28/YKkcMFBSU9SfuUt2/+6kvsXHPRKHJ9BO5ZuK+UEbVqID8ijmplrMzHo6lyWgciBsC0j81e5Rg0kuE6LpR9fzP35bQQIHZFJWDJHKkuDqJhivI2LXQy3wEe7HRr1WKfmNvf5MXDKFrftl2axydxYRVrCm5OIcdA6XJGKmOqGTtrDuGPpm4Nh7myKo3ftFdp/YjMnPXBezjJUnze6GNi17fRC69DOM2U4gSlJAAczU= -branches: - only: - - master - - dev - - swagger_update diff --git a/README.md b/README.md index d9307ad2..9767aeb2 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -[![Build Status](https://travis-ci.org/ProteinsWebTeam/interpro7-api.svg?branch=master)](https://travis-ci.org/ProteinsWebTeam/interpro7-api) +[![Unit and Funtional Testing](https://github.com/ProteinsWebTeam/interpro7-api/workflows/Unit%20and%20Funtional%20Testing/badge.svg)](https://github.com/ProteinsWebTeam/interpro7-api/actions?query=workflow%3A%22Unit+and+Funtional+Testing%22) [![Coverage Status](https://coveralls.io/repos/github/ProteinsWebTeam/interpro7-api/badge.svg?branch=master)](https://coveralls.io/github/ProteinsWebTeam/interpro7-api?branch=master) [![GitHub license](https://img.shields.io/badge/license-apache-blue.svg)](https://github.com/ProteinsWebTeam/interpro7-api/blob/master/LICENSE) [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)