-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI: Refactoring CI/CD for more efficiency
Signed-off-by: HarshCasper <erbeusgriffincasper@gmail.com>
- Loading branch information
1 parent
2e466c5
commit 0e7353f
Showing
3 changed files
with
60 additions
and
12 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 |
---|---|---|
@@ -1,22 +1,65 @@ | ||
# This workflow will install Conda environment, run tests and lint with a single version of Python. | ||
|
||
name: Continuous Integration | ||
|
||
on: | ||
schedule: | ||
- cron: "0 0 * * MON" | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ main, master ] | ||
branches: [ master ] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
ci: | ||
name: CI | ||
runs-on: ubuntu-latest | ||
env: | ||
DOCKER_BUILDKIT: "1" | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Lint using pylint | ||
run: docker build . --target lint | ||
- name: Test using pytest | ||
run: docker build . --target unit-test | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.7 | ||
|
||
- name: Setup Conda | ||
uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
python-version: 3.7 | ||
mamba-version: "*" | ||
channels: conda-forge | ||
channel-priority: true | ||
activate-environment: taswira | ||
|
||
- name: Cache conda | ||
uses: actions/cache@v2 | ||
env: | ||
# Increase this value to reset cache if environment.yml has not changed | ||
CACHE_NUMBER: 0 | ||
with: | ||
path: /usr/local/miniconda/envs/taswira | ||
key: | ||
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('environment.yml') }} | ||
id: envcache | ||
|
||
- name: Update Conda Environment | ||
run: mamba env update -n taswira -f environment.yml | ||
|
||
- name: Install Python package | ||
shell: bash -l {0} | ||
run: | | ||
conda activate taswira | ||
python -m pip install -e . | ||
- name: Run Black | ||
run: | | ||
python -m pip install black | ||
black src --diff | ||
black --check src | ||
- name: Test | ||
shell: bash -l {0} | ||
run: | | ||
conda activate taswira | ||
python -m pytest |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,3 +15,5 @@ dependencies: | |
- pylint>=2.5.2 | ||
- dash==1.13.3 | ||
- dash-leaflet==0.0.19 | ||
- markupsafe<2.1 | ||
- jinja2 |