-
Notifications
You must be signed in to change notification settings - Fork 271
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 #485 from kengz/fix-setup
Fix Setup
- Loading branch information
Showing
3 changed files
with
87 additions
and
43 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 |
---|---|---|
|
@@ -2,50 +2,93 @@ name: CI | |
|
||
on: | ||
push: | ||
branches: [ master ] | ||
branches: [master] | ||
pull_request: | ||
branches: [ master ] | ||
branches: [master] | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check out Git repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.7 | ||
|
||
- uses: liskin/gh-problem-matcher-wrap@v1 | ||
with: | ||
action: add | ||
linters: flake8 | ||
|
||
- name: Lint with flake8 | ||
shell: bash -l {0} | ||
run: | | ||
pip install flake8 | ||
# exit-zero treats all errors as warnings. | ||
flake8 . --ignore=E501 --exit-zero --statistics | ||
- uses: liskin/gh-problem-matcher-wrap@v1 | ||
with: | ||
action: remove | ||
linters: flake8 | ||
|
||
build: | ||
needs: lint | ||
runs-on: ubuntu-latest | ||
env: | ||
CB_URL: ${{ secrets.CB_URL }} | ||
CB_PASSPHRASE: ${{ secrets.CB_PASSPHRASE }} | ||
CB_SECRET_KEY: ${{ secrets.CB_SECRET_KEY }} | ||
CB_API_KEY: ${{ secrets.CB_API_KEY }} | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Cache Conda | ||
uses: actions/cache@v1 | ||
with: | ||
path: /usr/share/miniconda/envs/lab | ||
key: ${{ runner.os }}-conda-${{ hashFiles('environment.yml') }} | ||
restore-keys: | | ||
${{ runner.os }}-conda- | ||
- name: Setup Conda dependencies | ||
uses: goanpeca/setup-miniconda@v1 | ||
with: | ||
activate-environment: lab | ||
environment-file: environment.yml | ||
python-version: 3.7 | ||
auto-activate-base: false | ||
- name: Conda info | ||
shell: bash -l {0} | ||
run: | | ||
conda info | ||
conda list | ||
- name: Setup flake8 annotations | ||
uses: rbialon/flake8-annotations@v1 | ||
- name: Lint with flake8 | ||
shell: bash -l {0} | ||
run: | | ||
pip install flake8 | ||
# exit-zero treats all errors as warnings. | ||
flake8 . --ignore=E501 --count --exit-zero --statistics | ||
- name: Run tests | ||
shell: bash -l {0} | ||
run: | | ||
python setup.py test | ||
- name: Codeclimate test coverage | ||
uses: marsam/codeclimate-action@master | ||
with: | ||
command: echo 'Uploading test coverage' | ||
reporter-id: ${{ secrets.CC_TEST_REPORTER_ID }} | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Cache Conda | ||
uses: actions/cache@v2 | ||
env: | ||
# change from default size of 32MB to prevent 503 err | ||
CACHE_UPLOAD_CHUNK_SIZE: 67108864 | ||
with: | ||
path: /usr/share/miniconda/envs/lab | ||
key: ${{ runner.os }}-conda-${{ hashFiles('environment.yml') }} | ||
restore-keys: | | ||
${{ runner.os }}-conda- | ||
- name: Setup Conda dependencies | ||
uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
activate-environment: lab | ||
environment-file: environment.yml | ||
python-version: 3.7 | ||
auto-activate-base: false | ||
|
||
- name: Conda info | ||
shell: bash -l {0} | ||
run: | | ||
conda info | ||
conda list | ||
- uses: liskin/gh-problem-matcher-wrap@v1 | ||
with: | ||
action: add | ||
linters: pytest | ||
|
||
- name: Run tests | ||
shell: bash -l {0} | ||
run: | | ||
python setup.py test | ||
- uses: liskin/gh-problem-matcher-wrap@v1 | ||
with: | ||
action: add | ||
linters: pytest | ||
|
||
- name: Test & publish code coverage | ||
uses: paambaati/[email protected] | ||
env: | ||
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} |
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
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