From f8b918a2a15fbbd5447062bbd82d563239f07e2f Mon Sep 17 00:00:00 2001 From: satya7289 Date: Wed, 29 Jul 2020 20:13:34 +0530 Subject: [PATCH] feat: Github actions with codecov --- .github/workflows/main.yml | 120 +++++++++++++++++++++---------------- 1 file changed, 70 insertions(+), 50 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8b9dbe3e..6786503c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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/checkout@v2.3.1 - - name: Check Commit Messages - with: - fetch-depth: 0 + - uses: actions/checkout@v2.3.1 + with: + fetch-depth: 0 - uses: actions/setup-node@v2.1.0 - 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/checkout@v2.3.1 +# - name: Check Commit Messages +# with: +# fetch-depth: 0 +# - uses: actions/setup-node@v2.1.0 +# - 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