Skip to content

Commit

Permalink
Merge pull request #485 from kengz/fix-setup
Browse files Browse the repository at this point in the history
Fix Setup
  • Loading branch information
kengz authored May 17, 2021
2 parents 80d387d + 986ea33 commit dddff5e
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 43 deletions.
125 changes: 84 additions & 41 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/codeclimate-action@v2.7.5
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
1 change: 1 addition & 0 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ dependencies:
- box2d-py==2.3.8
- cloudpickle==0.5.2
- colorlover==0.3.0
- future==0.18.2
- opencv-python==4.1.0.25
- pyopengl==3.1.0
- ray==0.7.0
Expand Down
4 changes: 2 additions & 2 deletions slm_lab/spec/demo.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"start_val": 1.0,
"end_val": 0.1,
"start_step": 0,
"end_step": 1000,
"end_step": 1000
},
"gamma": 0.99,
"training_batch_iter": 8,
Expand Down Expand Up @@ -40,7 +40,7 @@
"lr_scheduler_spec": {
"name": "StepLR",
"step_size": 1000,
"gamma": 0.9,
"gamma": 0.9
},
"update_type": "polyak",
"update_frequency": 32,
Expand Down

0 comments on commit dddff5e

Please sign in to comment.