File tree Expand file tree Collapse file tree 3 files changed +60
-12
lines changed
Expand file tree Collapse file tree 3 files changed +60
-12
lines changed Original file line number Diff line number Diff line change 1- # This workflow will install Conda environment, run tests and lint with a single version of Python.
2-
31name : Continuous Integration
42
53on :
4+ schedule :
5+ - cron : " 0 0 * * MON"
6+ push :
7+ branches : [ master ]
68 pull_request :
7- branches : [ main, master ]
9+ branches : [ master ]
810 workflow_dispatch :
911
1012jobs :
1113 ci :
1214 name : CI
1315 runs-on : ubuntu-latest
14- env :
15- DOCKER_BUILDKIT : " 1"
16+
1617 steps :
1718 - name : Checkout code
1819 uses : actions/checkout@v2
19- - name : Lint using pylint
20- run : docker build . --target lint
21- - name : Test using pytest
22- run : docker build . --target unit-test
20+
21+ - name : Setup Python
22+ uses : actions/setup-python@v2
23+ with :
24+ python-version : 3.7
25+
26+ - name : Setup Conda
27+ uses : conda-incubator/setup-miniconda@v2
28+ with :
29+ python-version : 3.7
30+ mamba-version : " *"
31+ channels : conda-forge
32+ channel-priority : true
33+ activate-environment : taswira
34+
35+ - name : Cache conda
36+ uses : actions/cache@v2
37+ env :
38+ # Increase this value to reset cache if environment.yml has not changed
39+ CACHE_NUMBER : 0
40+ with :
41+ path : /usr/local/miniconda/envs/taswira
42+ key :
43+ ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('environment.yml') }}
44+ id : envcache
45+
46+ - name : Update Conda Environment
47+ run : mamba env update -n taswira -f environment.yml
48+
49+ - name : Install Python package
50+ shell : bash -l {0}
51+ run : |
52+ conda activate taswira
53+ python -m pip install -e .
54+
55+ - name : Run Black
56+ run : |
57+ python -m pip install black
58+ black src --diff
59+ black --check src
60+
61+ - name : Test
62+ shell : bash -l {0}
63+ run : |
64+ conda activate taswira
65+ python -m pytest
Original file line number Diff line number Diff line change 1- name : Taswira CD
1+ name : Docker CI/ CD
22
33on :
44 schedule :
55 - cron : " 0 0 * * MON"
6-
6+ pull_request :
7+ branches : [ master ]
78 push :
89 branches : [ master ]
910 # Publish semver tags as releases.
1011 tags : [ 'v*.*.*' ]
12+ workflow_dispatch :
1113
1214env :
1315 REGISTRY : ghcr.io
2830 uses : docker/setup-buildx-action@v1
2931
3032 - name : Log into GitHub Container Registry
33+ if : ${{ github.event_name != 'pull_request' }}
3134 uses : docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c
3235 with :
3336 registry : ${{ env.REGISTRY }}
4447 uses : docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
4548 with :
4649 context : .
47- push : true
50+ push : ${{ github.event_name != 'pull_request' }}
4851 tags : ${{ steps.meta.outputs.tags }}
4952 labels : ${{ steps.meta.outputs.labels }}
5053 cache-from : type=gha
Original file line number Diff line number Diff line change @@ -15,3 +15,5 @@ dependencies:
1515 - pylint>=2.5.2
1616 - dash==1.13.3
1717 - dash-leaflet==0.0.19
18+ - markupsafe<2.1
19+ - jinja2
You can’t perform that action at this time.
0 commit comments