-
Notifications
You must be signed in to change notification settings - Fork 6
69 lines (59 loc) · 1.73 KB
/
ci.yml
File metadata and controls
69 lines (59 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: Continuous Integration
on:
schedule:
# Run this workflow at 00:00 on every Monday
- cron: "0 0 * * MON"
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
jobs:
build-test-taswira:
name: Build and Test Taswira
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- 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:
# Cache the path where dependencies are installed with a key unique to the existing environment.yml
path: /usr/local/miniconda/envs/taswira
key:
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('environment.yml') }}
id: envcache
- name: Update Conda Environment
# Setup (or update) the environment for faster installs
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}
# Test the package
run: |
conda activate taswira
python -m pytest