diff --git a/.coveragerc b/.coveragerc index 234bceb1..592ba6d2 100644 --- a/.coveragerc +++ b/.coveragerc @@ -13,6 +13,7 @@ source = parallel = true concurrency = multiprocessing data_file = data/.coverage +relative_files = True [html] directory = htmlcov diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..9797ed66 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,60 @@ +name: CI +on: + push: + branches: + - master + pull_request: + branches: + - master +jobs: + test: + runs-on: ubuntu-latest + env: + DJANGO_SETTINGS_MODULE: babybuddy.settings.ci + strategy: + max-parallel: 4 + matrix: + python-version: [ 3.6, 3.7, 3.8 ] + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - uses: actions/setup-node@v2 + with: + node-version: '10' + - run: npm install -g gulp-cli + - run: npm install + - name: Install pipenv + run: | + python -m pip install --upgrade pipenv wheel + - name: Cache Python dependencies + id: cache-pipenv + uses: actions/cache@v2 + with: + path: ~/.local/share/virtualenvs + key: ${{ runner.os }}-python-${{ matrix.python-version }}-pipenv-${{ hashFiles('**/requirements.txt') }} + restore-keys: | + ${{ runner.os }}-python-${{ matrix.python-version }}-pipenv- + - name: Install dependencies + if: steps.cache-pipenv.outputs.cache-hit != 'true' + run: | + pipenv install --deploy --dev + - run: gulp lint + - run: gulp coverage + - name: Submit results to Coveralls + uses: AndreMiras/coveralls-python-action@develop + with: + github-token: ${{ secrets.github_token }} + flag-name: test-python-${{ matrix.python-version }} + parallel: true + coveralls_finish: + needs: test + runs-on: ubuntu-latest + steps: + - name: Coveralls Finished + uses: AndreMiras/coveralls-python-action@develop + with: + github-token: ${{ secrets.github_token }} + parallel-finished: true diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index f5667225..00000000 --- a/.travis.yml +++ /dev/null @@ -1,34 +0,0 @@ -os: linux -language: generic -dist: bionic -jobs: - include: - - name: "Python 3.6" - before_install: - - pyenv global `pyenv versions | tr -d "[:blank:]" | grep -Po "3\.6\.[\d]+" | tail -1` - - name: "Python 3.7" - before_install: - - pyenv global `pyenv versions | tr -d "[:blank:]" | grep -Po "3\.7\.[\d]+" | tail -1` - - name: "Python 3.8" - before_install: - - pyenv global `pyenv versions | tr -d "[:blank:]" | grep -Po "3\.8\.[\d]+" | tail -1` -cache: - directories: - - $HOME/.cache/pip - - node_modules -env: - - DJANGO_SETTINGS_MODULE="babybuddy.settings.travis" -install: - - nvm use 10 - - npm install -g gulp-cli - - npm install - - pip install pipenv - - pipenv --python `pyenv which python` install --dev -before_script: - - gulp lint -script: - - gulp coverage -after_success: - - pipenv run coveralls -notifications: - email: false diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0a58bde5..cd100416 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,5 @@ # Contributing -[![Build Status](https://travis-ci.org/babybuddy/babybuddy.svg?branch=master)](https://travis-ci.com/babybuddy/babybuddy) [![Coverage Status](https://coveralls.io/repos/github/babybuddy/babybuddy/badge.svg?branch=master)](https://coveralls.io/github/babybuddy/babybuddy?branch=master) - [Contributions](#contributions) diff --git a/babybuddy/settings/travis.py b/babybuddy/settings/ci.py similarity index 86% rename from babybuddy/settings/travis.py rename to babybuddy/settings/ci.py index 09f97059..80fbda46 100644 --- a/babybuddy/settings/travis.py +++ b/babybuddy/settings/ci.py @@ -1,6 +1,6 @@ from .base import * -SECRET_KEY = 'TRAVISCIWHYNOT' +SECRET_KEY = 'CISECRETKEYIGUESS' # Static files (CSS, JavaScript, Images)