-
Notifications
You must be signed in to change notification settings - Fork 1
48 lines (46 loc) · 1.42 KB
/
build.yml
File metadata and controls
48 lines (46 loc) · 1.42 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
name: Build Project
on: [push]
jobs:
code-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: pre-commit/action@v2.0.3
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Cache conda
uses: actions/cache@v2
env:
CACHE_NUMBER: 0 # Increase this value to reset cache if environment.yml has not changed
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('environment.yml') }}
- name: Cache pip dependencies
uses: actions/cache@v2
env:
CACHE_NUMBER: 0 # Increase this value to reset cache if requirement files did not change
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ env.CACHE_NUMBER }}-${{ hashFiles('poetry.lock') }}
- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v2.1.1
with:
auto-update-conda: true
environment-file: environment.yml
- name: Install Poetry
uses: abatilo/actions-poetry@v2.0.0
with:
poetry-version: 1.1.13
- name: Install pip dependencies
shell: bash -l {0}
run: |
poetry env info
poetry install
pip list
- name: Run tests using pytest
shell: bash -l {0}
run: |
invoke test --cov