Skip to content

Commit

Permalink
Merge pull request #10 from erunks/github-workflows
Browse files Browse the repository at this point in the history
Setup Github Workflows
  • Loading branch information
erunks authored Oct 12, 2020
2 parents 8bdcdc3 + 39ec7eb commit 77bf1bb
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: CI

on:
push:
branches: [ master ]

jobs:
generate-and-upload-coverage:
runs-on: ubuntu-latest

if: github.event.pull_request.merged == true
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.6

- name: Run setup
run: |
python3 -m pip install -r requirements.txt
python3 -m pip install -r requirements-dev.txt
- name: Generate coverage
run: |
chmod +x $GITHUB_WORKSPACE/scripts/generate_coverage.sh
sh $GITHUB_WORKSPACE/scripts/generate_coverage.sh
- name: Upload coverage
env:
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
run: |
chmod +x $GITHUB_WORKSPACE/scripts/upload_coverage.sh
sh $GITHUB_WORKSPACE/scripts/upload_coverage.sh
28 changes: 28 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: CI

on:
pull_request:
branches: [ master ]

jobs:
build-and-test:
runs-on: ubuntu-latest

steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.6

- name: Run setup
run: |
python3 -m pip install -r requirements.txt
python3 -m pip install -r requirements-dev.txt
cp .env.sample .env
- name: Run tests
run: |
chmod +x $GITHUB_WORKSPACE/scripts/run_tests.sh
sh $GITHUB_WORKSPACE/scripts/run_tests.sh
2 changes: 2 additions & 0 deletions scripts/upload_coverage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
bash <(curl -Ls https://coverage.codacy.com/get.sh) report -l Python -r coverage.xml

0 comments on commit 77bf1bb

Please sign in to comment.