-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
han: refactor: added workflows and pylintrc
- Loading branch information
1 parent
eab9af0
commit bafb7be
Showing
3 changed files
with
509 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,52 @@ | ||
name: Build | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: STEP 1. Check out repo | ||
uses: actions/checkout@v2 | ||
#===============================================# | ||
- name: STEP 2. Set up Python 3.7 | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: 3.7 | ||
#===============================================# | ||
- name: STEP 3. Install pipenv dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install pipenv | ||
python -m pipenv install --dev --system | ||
#===============================================# | ||
- name: STEP 4. Lint with pylint | ||
run: | | ||
pipenv run pylint --rcfile=.pylintrc api | ||
#===============================================# | ||
- name: STEP 5. Test with pytest | ||
env: | ||
MONGODB_CONNECTION_URI: ${{ secrets.MONGODB_CONNECTION_URI }} | ||
TWITTER_CONSUMER_KEY: ${{ secrets.TWITTER_CONSUMER_KEY }} | ||
TWITTER_CONSUMER_SECRET_KEY: ${{ secrets.TWITTER_CONSUMER_SECRET_KEY }} | ||
TWITTER_ACCESS_TOKEN: ${{ secrets.TWITTER_ACCESS_TOKEN }} | ||
TWITTER_ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }} | ||
NEWS_API_KEY: ${{ secrets.NEWS_API_KEY }} | ||
COUNTY_URL: ${{ secrets.COUNTY_URL }} | ||
STATE_CONFIRMED: ${{ secrets.STATE_CONFIRMED }} | ||
STATE_DEATH: ${{ secrets.STATE_DEATH }} | ||
NYT_STATE: ${{ secrets.NYT_STATE }} | ||
run: | | ||
coverage run --omit */.virtualenvs/* -m pytest api | ||
#===============================================# | ||
- name: STEP 6. Generate coverage reports | ||
env: | ||
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN}} | ||
run: | | ||
coveralls |
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,52 @@ | ||
name: Staging | ||
|
||
on: | ||
push: | ||
branches: [ staging ] | ||
pull_request: | ||
branches: [ staging ] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: STEP 1. Check out repo | ||
uses: actions/checkout@v2 | ||
#===============================================# | ||
- name: STEP 2. Set up Python 3.7 | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: 3.7 | ||
#===============================================# | ||
- name: STEP 3. Install pipenv dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install pipenv | ||
python -m pipenv install --dev --system | ||
#===============================================# | ||
- name: STEP 4. Lint with pylint | ||
run: | | ||
pipenv run pylint --rcfile=.pylintrc api | ||
#===============================================# | ||
- name: STEP 5. Test with pytest | ||
env: | ||
MONGODB_CONNECTION_URI: ${{ secrets.MONGODB_CONNECTION_URI }} | ||
TWITTER_CONSUMER_KEY: ${{ secrets.TWITTER_CONSUMER_KEY }} | ||
TWITTER_CONSUMER_SECRET_KEY: ${{ secrets.TWITTER_CONSUMER_SECRET_KEY }} | ||
TWITTER_ACCESS_TOKEN: ${{ secrets.TWITTER_ACCESS_TOKEN }} | ||
TWITTER_ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }} | ||
NEWS_API_KEY: ${{ secrets.NEWS_API_KEY }} | ||
COUNTY_URL: ${{ secrets.COUNTY_URL }} | ||
STATE_CONFIRMED: ${{ secrets.STATE_CONFIRMED }} | ||
STATE_DEATH: ${{ secrets.STATE_DEATH }} | ||
NYT_STATE: ${{ secrets.NYT_STATE }} | ||
run: | | ||
coverage run --omit */.virtualenvs/* -m pytest api | ||
#===============================================# | ||
- name: STEP 6. Generate coverage reports | ||
env: | ||
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN}} | ||
run: | | ||
coveralls |
Oops, something went wrong.