-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from erunks/github-workflows
Setup Github Workflows
- Loading branch information
Showing
3 changed files
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |