Skip to content
This repository has been archived by the owner on Jan 26, 2021. It is now read-only.

Commit

Permalink
feat: Github actions with codecov
Browse files Browse the repository at this point in the history
  • Loading branch information
satya7289 committed Jul 29, 2020
1 parent bafacb1 commit f8b918a
Showing 1 changed file with 70 additions and 50 deletions.
120 changes: 70 additions & 50 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,56 +1,76 @@
name: Run tests
on:
pull_request:
branches: [ develop ]

on:
pull_request:
branches: [ develop ]

jobs:
run:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: [3.7]
env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python-version }}

check-commits:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: Check Commit Messages
with:
fetch-depth: 0
- uses: actions/[email protected]
with:
fetch-depth: 0
- uses: actions/[email protected]
- run: yarn add @commitlint/{config-conventional,cli}
- run: yarn run commitlint --from HEAD~${{ github.event.pull_request.commits }} --to HEAD
- name: Setup Python
uses: actions/setup-python@develop
with:
python-version: 3.7
- uses: harmon758/postgresql-action@v1
with:
postgresql version: '11' # See https://hub.docker.com/_/postgres for available versions
- name: Setup geckodriver
- run: |
wget https://github.com/mozilla/geckodriver/releases/download/v0.20.1/geckodriver-v0.20.1-linux64.tar.gz
tar -xzvf geckodriver-v0.20.1-linux64.tar.gz
sudo mv geckodriver /usr/local/bin
- name: Install dependencies
- run: |
pip install -r requirements/dev.txt
pip install coveralls==0.4.4
sudo apt-get install python-gdal
- name: Setup after Installation
- run: |
export GOOGLE_MAPS_API_KEY=$GOOGLE_MAPS_API_KEY
export SECRET_KEY=foobarbaz
psql -c "CREATE DATABASE systersdb;" -U postgres
- name: Check flake8
- run: |
flake8 systers_portal
- name: Run tests
- run: |
coverage run systers_portal/manage.py test --settings=systers_portal.settings.testing
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
name: codecov-umbrella
fail_ci_if_error: true




# name: Run tests
# on:
# pull_request:
# branches: [ develop ]
# jobs:
# run:
# runs-on: ${{ matrix.os }}
# strategy:
# matrix:
# os: [ubuntu-latest]
# python-version: [3.7]
# env:
# OS: ${{ matrix.os }}
# PYTHON: ${{ matrix.python-version }}

# steps:
# - uses: actions/[email protected]
# - name: Check Commit Messages
# with:
# fetch-depth: 0
# - uses: actions/[email protected]
# - run: yarn add @commitlint/{config-conventional,cli}
# - run: yarn run commitlint --from HEAD~${{ github.event.pull_request.commits }} --to HEAD
# - name: Setup Python
# uses: actions/setup-python@develop
# with:
# python-version: 3.7
# - uses: harmon758/postgresql-action@v1
# with:
# postgresql version: '11' # See https://hub.docker.com/_/postgres for available versions
# - name: Setup geckodriver
# - run: |
# wget https://github.com/mozilla/geckodriver/releases/download/v0.20.1/geckodriver-v0.20.1-linux64.tar.gz
# tar -xzvf geckodriver-v0.20.1-linux64.tar.gz
# sudo mv geckodriver /usr/local/bin
# - name: Install dependencies
# - run: |
# pip install -r requirements/dev.txt
# pip install coveralls==0.4.4
# sudo apt-get install python-gdal
# - name: Setup after Installation
# - run: |
# export GOOGLE_MAPS_API_KEY=$GOOGLE_MAPS_API_KEY
# export SECRET_KEY=foobarbaz
# psql -c "CREATE DATABASE systersdb;" -U postgres
# - name: Check flake8
# - run: |
# flake8 systers_portal
# - name: Run tests
# - run: |
# coverage run systers_portal/manage.py test --settings=systers_portal.settings.testing
# - name: Upload coverage to Codecov
# uses: codecov/codecov-action@v1
# with:
# name: codecov-umbrella
# fail_ci_if_error: true

0 comments on commit f8b918a

Please sign in to comment.