-
Notifications
You must be signed in to change notification settings - Fork 10
64 lines (56 loc) · 1.86 KB
/
test.yml
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
name: Test
on:
push:
branches:
- master
pull_request:
workflow_dispatch:
jobs:
miniconda:
name: Miniconda ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ["ubuntu-latest"]
steps:
- name: check out xpdtools
uses: actions/checkout@v3
with:
repository: xpdacq/xpdtools
# for bookkeeping have diffpy.snmf at the same level as everything else in the
# directory tree
path: .
- name: initialize miniconda
# this uses a marketplace action that sets up miniconda in a way that makes
# it easier to use. I tried setting it up without this and it was a pain
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: test
# environment.yml file is needed by this action. Because I don't want
# maintain this but rather maintain the requirements files it just has
# basic things in it like conda and pip
auto-update-conda: true
environment-file: ./environment.yml
auto-activate-base: false
- name: install requirements
shell: bash -l {0}
run: |
conda config --set always_yes yes --set changeps1 no
conda config --add channels conda-forge
conda activate test
conda install --file requirements.txt --file requirements-dev.txt
python -m pip install . --no-deps
- name: run the tests and check for test coverage
shell: bash -l {0}
run: |
conda activate test
coverage run -m pytest
coverage report -m
codecov
- name: check the code style
shell: bash -l {0}
run: |
conda activate test
flake8
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3